Possible Duplicate:
mysql_fetch_array() expects parameter 1 to be resource, boolean given in select
So I am trying to check if the following query returns any result or not
$numUsersSameRatingQuery="SELECT * `user ratings` WHERE category='$category' AND categoryId='$categoryId' AND `userAromaRating`>0 ";
$result=mysql_query($numUsersSameRatingQuery);
$numResults=mysql_num_rows($result);
if($numResults==0)
{
// do the INSERT INTO
}
else
{
//do the UPDATE SET
}
However, the above returns the following error and the if($numResults)
is executed anyway each time. In other words, I can never get the else
block to run.
Here is the error
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\boozeDb\profileThis.php on line 141
Helps are appreciated.