Does anyone know how to count how many rows are in a mysql table? This is
what I have, but it doesn't work right:
<?
$db = mysql_connect(" localhost", "username", "password") ;
mysql_select_db ("database",$db );
$sql = "SELECT COUNT(*) FROM table";
$result = mysql_query($sq l);
echo "$result";
?>
This returns "Resource id #3". All it should say is '2'. Can anyone tell me
what I'm doing wrong?
Thanks,
Matt
what I have, but it doesn't work right:
<?
$db = mysql_connect(" localhost", "username", "password") ;
mysql_select_db ("database",$db );
$sql = "SELECT COUNT(*) FROM table";
$result = mysql_query($sq l);
echo "$result";
?>
This returns "Resource id #3". All it should say is '2'. Can anyone tell me
what I'm doing wrong?
Thanks,
Matt
Comment