"Sharif T. Karim" <sh****@nyc.rr. com> wrote in message news:<Sc******* ***********@twi ster.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