Hello,

I have a table "Members" with the following fields: id, email, name. Before a new user sign up I want to check and see if their e-mail address is already in the database. I've created the following code:

$result = mysql_query("SELECT * FROM Members WHERE email='$email'");
if ($result) {
echo("<P>E-mail address already in database!");
exit();
}

But this code is not correct. The variable $result is true even if it doesn't find the e-mail address in the database (it took me a while to figure this out). How do I check if the e-mail address is already in the database? Please, the easy way!