RE: [PHP] google style paginating
| From: | Chris W. Parker | Date: | Thu, 21 Aug 2003 21:59:02 +0000 |
| Subject: | RE: [PHP] google style paginating | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-160361@lists.php.net to get a copy of this message | ||
Ted Conn <mailto:tedc@scinet.com.mx>
on Thursday, August 21, 2003 2:01 PM said:
> Hi I am new to this newsgroup and I plan on replying to all the posts
> I can for now...
Hopefully those replies will be useful. ;)
> I'll show you the code I am using
> now for next and back buttons...
Hmm... that's a lot of code. What exactly am I supposed to do with it?
But anways... To do what google does you'll have to figure out how many
records there are in total first. (At least that is how I do it.)
It goes like this.
1. someone searches for something
2. you pull back a complete list of records
3. count them
4. store the number somewhere
5. display the first ten results along with page numbers
6. user clicks next page
7. pass the stored record count to the next page
8. use the LIMIT query to pull back only the next records
9. dislpay the next records, use the stored value (that you passed in
step 7) to create your page numbers
10. rinse repeat
Does that help?
Chris.