When registering the email, do this:
PHP Code:
$sql = "SELECT *
FROM `your_table`
WHERE `email`='".$useremail."'";
$sql = @mysql_query($sql);
if(!$sql){die("MySQL Error! ".mysql_error()); }
$sql = @mysql_fetch_array($sql);
if(!empty($sql['email'])){
die "Error, email already in use.";
}
Theres quite a few things you need to change there though.
- In the query, change the table name to your table name
- In the query, change the `email` column to the correct name.
- $useremail is the value of the email thats about to be submitted. This is the email that we are checking for duplicates of.
- you need to change $sql['emai'] to $sql['whatever_your_email_column_is'];.
If it doesnt work, post the SQL error or Parse error or whatever.
|