Results 1 to 3 of 3
Feb 13, 2005, 20:59 #1
Making sure there is no duplicate data.
How do I make sure that duplicate data isn't stored in a table?
In other words, if record 1 has the email address "firstname.lastname@example.org", I want to make sure that no other records that are created can have the email address email@example.com.
Right now, I'm solving this problem through PHP by checking if that email address exists before inserting it. But isn't there a way to do this through mysql? I though there was a certain way to set up a table so that duplicate data couldn't be inserted.
Feb 13, 2005, 21:43 #2
- Join Date
- Jan 2005
- 0 Post(s)
- 0 Thread(s)
read some info on unique indexes, i don't got the time to give specific cmds to run don't got time atm but read that, add a unique index on that email column and everytime it will try to add something it will check if it's a dupe or not
Feb 13, 2005, 22:05 #3
Thank you. I'll look into that.