Results 1 to 2 of 2
Thread: Unique Keys & Inserting Dates
Sep 3, 2000, 08:36 #1
- Join Date
- Jul 2000
- 0 Post(s)
- 0 Thread(s)
Question 1: HOw can I avoid adding duplicate entries. I was reading something about a unique constraint but found out that mySQL does not support that. I already have another column as my primary key. If I make the "Business Name" the primary key, will this avoid duplicate entries with the same business name? How can I add or change the primary key on existing columns?
Question 2: I am trying to insert the expiration date when the business listing is submitted from my PHP3 pages. I was trying the current date function + an INTERVAL. But nothing was being inserted into my mySQL database column....
This is what I was inserting into my PHP 3 page:
"Expiration_Date=CURDATE(), INTERVAL 6 MONTH)";
I also tried many variations, and nothing worked...I know you can do this for Select queries, but can you use this method for INSERT?