I tried to search and found some similar questions but none seemed to help with my code. I upgraded to a new server:
- MySQL = 5.0.96-community
- PHP = 4.4.9
I get following error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /path/to/file/filename.php on line 209
Here's the Line 209:
$num_rows = mysql_num_rows($result);
The code right above it for reference is:
<?
// Connect to DB
$db = mysql_connect("localhost","db_name","password");
if (!$db)
{
echo "No connection.";
exit;
}
mysql_select_db("db_name");
$v = str_replace(' ','_',$v);
$query = "SELECT * FROM reviews";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);