Change the command to count rows (count -> mysql_num_rows)