This is the error I'm getting:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/pkghost/public_html/php/users/register.php on line 26
I'm doing a user login tutorial, and i run into trouble when i try to query the database and see if the username and email address that the user is attempting to register already exist. this is the code
if($password == $confirm){ //if the password fields match, check their email address against the database
$mailQ = "SELECT * FROM users WHERE email=$email, $db";
$result = mysql_query($mailQ);
$num_mails = mysql_num_rows($result);
if($num_mails == 0){ //if there are no entries for the query, then check the username...
//more code
So the mysql_num_rows($result) is where I'm having trouble. I don't know why its not working, ive fiddled here and there and it won't cooperate. Also, is there a better way to check if an entry already exists in teh database other than SELECT and checking the number of rows in the selection? thanks