I can't get this function to work. A sample code:
And I'm getting the following error:
Why is this happening?
Code:
<?
$link = mysql_connect("localhost", "users", "users");
mysql_select_db("users", $link);
$result = mysql_query("SELECT * FROM user", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows\n";
?>
And I'm getting the following error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/pollock7/public_html/new/hell.php on line 7
Rows
Why is this happening?