June 19th, 2000, 09:37 AM
Any easy way to check for duplicates?
Or do I have to do this in a crappy way
June 19th, 2000, 12:27 PM
For any field in a MySQL table, you have 3 options for field constraints:
PRIMARY, INDEX, and UNIQUE
In your case, just use the UNIQUE constraint and MySQL will generate a standard error if you try to insert a duplicate record. If you want, from there you can handle it with your server-side programming to generate the appropriate 'retry' message.
June 20th, 2000, 10:05 AM
so say I have a database of people
I go to enter in John Smith for the second time....there will be an error and I could make it do something?
I'll read up on it on mysql.com i guess
June 22nd, 2000, 12:13 AM
What server-side programming language are you using?
Since I have an interest in this thread, I will answer in my case.
I am using PHP 4.01 -- how would this be done?