Re: Getting total results

From: Date: Wed, 29 Dec 2004 10:35:38 +0000
Subject: Re: Getting total results
References: 1 2 3 4 5  Groups: php.db 
Request: Send a blank email to php-db+get-37906@lists.php.net to get a copy of this message
Joseph Crawford wrote:
php 4 version is posted, let me know if you like it or not. Please keep in mind it is a very basic class, you could extend this in many ways, especially to make the nav bar do something like << 1 2 3 4 .... 25 26 27 28 >>
Hi Joseph, thanx for your reply. I do already have some classe which do most of the job and I would rather not like to change the whole system. Johns suggestion seems sufficent to me. It works excellent in my case: SELECT FOUND_ROWS() to get the total number of rows there would have been without the limit. Still two queries (no way around that, anyhow), but hopefully optimized better by MySQL. Perform your own tests, of course. See the documentation on FOUND_ROWS() at the following URL for more info: http://dev.mysql.com/doc/mysql/en/Information_functions.html Thank you everybody, Merlin

« previous php.db (#37906) next »