Menu
Hi
I am not sure if this is a MySql or php problem.
How do I check if a mysql table is empty?
I have used this code:
[CODE]
$Exist = “SELECT * FROM log WHERE CName=’$CName’ AND League=’$Liga AND Day=’$Days'”;
$result = mysql_query($Exist);
$num=mysql_numrows($result);
to search the table for the content but if the table is empty with no data rows in it I get the following error.
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in C:XitamiwebpagesWPCricketData AdminAddresult.php on line 266
Line 266 is $num=mysql_numrows($result);
How do I prevent this error?
Pleas help.