$NumPMs = mysql_query("SELECT * FROM messages WHERE to_user='$name' AND read='0'") or die (mysql_error());
$numofpms = mysql_num_rows($NumPMS);
I get this error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'read='0'' at line 1
It doesn't make sense. It should be working.
Help would be appreciated!
EDIT:
I changed the query to this: $NumPMs = mysql_query("SELECT * FROM messages WHERE to_user
='$name' AND read
='0'") or die (mysql_error());
It works. Although, my mysql_num_rows flares an error too: Warning: mysql_num_rows() expects parameter 1 to be resource, null given in /home/recatio2/public_html/Main.php on line 78
Please help.