Forum Moderators: coopster
The only problem is that I have already registered with that very email address several times now and the PHP code is supposed to check to make sure the username, password and email are not already in the DB. It isnt doing that however. Its almost as if its totally skipping over that code all together and then writing it back to the DB (the same email addy over and over again).
Here is the code to check for the email addy
$SQL = "SELECT * account WHERE email ='".$email."'";
$rs = mysql_query($SQL,$conn);
$numRows = mysql_num_rows($rs);
if($numRows > 0){
echo 'result=emailExists';
exit('&result=emailExists&');//abort php script
}
Any suggestions?
SELECT * account WHERE email ='".$email."'
correct:
SELECT *
FROM
account WHERE email ='".$email."'
also from a SQL labor stand point of view
avoid as much as possible *
instead specify what are the really required fields
and to keep it simple
I'll rather do ='$email'
<edit>
forgot about a simple debug check:
echo your query for example in phpmyadmin
copy and paste in phpmyadmin SQL tab:
SELECT *
FROM
account WHERE email ='".$email."'
and watch the error popping up :)</edit>