This question already has an answer here:
- mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows etc… expects parameter 1 to be resource or result 32 answers
I've just changed a site over to a new server, and now I'm getting an error with this code:
<?php
$result = mysql_query("SELECT * FROM trends ");
$num_rows = mysql_num_rows($result);
echo "<strong>" . $num_rows . "</strong>";
?>
The error is:
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given.
How can I fix this?
Cheers.