I am getting the error: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in.... on line ..
Please can you tell me what I am doing wrong to cause this. I don’t believe that I am.
if (mysql_num_rows(mysql_query("SELECT * FROM Likes WHERE `postID` = '$postID' AND `userID` = '$accountID'")) < 1) {
exit("Cant like a post twice");
}
you can also simplify your sql by selecting the count directly from the database, which is more efficient then selecting all the rows, and then calculating the count