This question already has an answer here:
I have an error which was coming from this code the errors is
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/quick/public_html/tvhd.in/xamii/Channel-Detail.php on line 62
Warning: Cannot modify header information - headers already sent by (output started at /home/quick/public_html/tvhd.in/xamii/Channel-Detail.php:62) in /home/quick/public_html/tvhd.in/xamii/Channel-Detail.php on line 64
an one could help thatwould be fine
</div>
Error Checking. Error Checking. Error Checking!!!
// $result will be boolean FALSE if there is a failure in the query
// This is not the same as if there were 0 results
$result = mysql_query('SELECT * FROM SOMETABLE');
if (!$result) {
// The query has an error, so you can't use mysql_num_rows
die(mysql_error()); // <!-- This will tell you why. psuedo error checking!
}
// If we make it this far, its safe to use mysql_num_rows and $result
$rows = mysql_num_rows($result);
Now, stop using mysql_ functions! They are deprecated. A 5 second glance at the online documentation would have answered this question and told you not to use mysql_. See the big red box.