Here is a little snippet
$query_count = "SELECT COUNT(*) FROM table"; //method 1
$query_count = "SELECT ID FROM table"; //method 2
$result_count = mysql_query($query_count);
$totalrows = mysql_num_rows($result_count);
echo $totalrows;
Now if I use method 1 the figure returnd it 1, but with method 2 it gives me the right answer (239)
What is going on, i would prefer method one as it does not extract the data, just counts it.
Cheers
In method 2 of course, you get the number of records matching the search criteria. Each row in the results set contains an ID