Getting total results
| From: | Merlin | Date: | Tue, 28 Dec 2004 20:47:39 +0000 |
| Subject: | Getting total results | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-37896@lists.php.net to get a copy of this message | ||
Hello everybody,
I am trying to split results comming from a mysql db with php into more html pages. Example: Results 1-10 out of 100
Therefor I limit the sql statement with: limit 1, 10
The sql statement is very complex. So far I have always used the same statement but without the limit and with a count inside to get the total number of results.
Now with this statement it would be a huge decrease in performance. Is there a way to work with the limit statement, but to get the total number of results?
As far as I know the LIMIT command only limits the visiblity, but mysql queries all the data.
Any ideas which could help?
Thank you in advance, Merlin