Re: Pagination
From: Phil Powell (soazine_at_erols.com)
Date: 07/07/04
- Next message: Justin Koivisto: "Re: Register_Globals on on some website"
- Previous message: Derek Battams: "Re: Writing array to csv string"
- In reply to: Sharif T. Karim: "Pagination"
- Next in thread: Geoff Berrow: "Re: Pagination"
- Reply: Geoff Berrow: "Re: Pagination"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 7 Jul 2004 09:08:04 -0700
"Sharif T. Karim" <sharif@nyc.rr.com> wrote in message news:<ScHGc.60845$a92.5783@twister.nyc.rr.com>...
> Anyone know of a up-to-date tutorial for pagination where I can have it
> like:
>
> Prev 1 2 3 4 Next
>
> Thanks.
My concept of pagination, if it helps, is to perform the following
steps:
1) One single DB call to grab everything at one time that you need to
list
2) Store entire contents of the resultset into a $_SESSION variable
(serialized, of course)
3) Establish a $prev and $next routine with integer values that limit
the amount of display per page and calculate your $prev and $next
4) Upon each click of your "Previous" and "Next" links you will pull
not from the DB but from the serialized $_SESSION variable to ensure
efficiency and data reusability
5) Filter results by $prev and $next to only display the results you
need per page
6) Also allow for a "view all" link if the user wants to see
everything at one time
7) *Important* When you go to view another set of stuff, be sure to
"flush" the cache by destroying the $_SESSION variable to ensure not
having latent results floating around in your $_SESSION cache.
My $0.02
Phil
- Next message: Justin Koivisto: "Re: Register_Globals on on some website"
- Previous message: Derek Battams: "Re: Writing array to csv string"
- In reply to: Sharif T. Karim: "Pagination"
- Next in thread: Geoff Berrow: "Re: Pagination"
- Reply: Geoff Berrow: "Re: Pagination"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|