Hi. I want to query some data in MYSQL and show the results in page order in
some fashion (ORDER BY ...)
I've been using the LIMIT sentence like this

       LIMIT offset, max_per_page

so if max_per_page = 5 then the first time the sentence will be "LIMIT 0,
5", in page 2 "LIMIT 5,5" and so no.


My problem is how to calculate how many rows the result returned. By now,
the first time I'm querying without the LIMIT sentenced, and then store
mysql_num_rows() to know have many pages there will be (i.e. maxrows =
mysql_num_rows()/5).

Is this right? Is there other efficent way to do it?
What about if data changes (i.e. new records are added) while the user
browses through pages?

Thanks!




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to