Keep It Simple, Stupid | |
PerlMonks |
Re: Checking for Dupes in MySQLby jeroenes (Priest) |
on Nov 29, 2001 at 14:54 UTC ( [id://128322]=note: print w/replies, xml ) | Need Help?? |
Standard SQL (dunno whether mysql supports it): add a UNIQUE modifier in the CREATE TABLE statement at the e-mail column. Afterwards, your dbase won't allow duplicate e-mail addresses.
Be sure to add decent error-checking to inform your prospective users why their entry was not allowed. Jeroen
In Section
Seekers of Perl Wisdom
|
|