Forums

This topic is locked

COUNT(*) problem

Posted 13 Mar 2007 01:18:44
1
has voted
13 Mar 2007 01:18:44 Alan C posted:
Any comments or suggestions on this are welcome . . .

I'm trying to count the records for recordset paging, I've looked at some examples and the suggestion is that you should count the records using something like

"SELECT COUNT(*) FROM properties WHERE p_admin_hold ='normal'"

The problem is I have it that when I execute that in my script then use mysql_num_rows to see how many rows were returned I always get 1

If I change the query to "SELECT * FROM properties WHERE p_admin_hold ='normal'"
then I get the expected result, yes I can leave it at that, or just select one field, but count is supposed to be faster

My server is running mysql 4.1.21

Reply to this topic