Re: Pagination

From: Phil Powell (soazine_at_erols.com)
Date: 07/07/04


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



Relevant Pages

  • getting the user the app is running as
    ... Is there a relatively simple way to grab and display what user the ... I'm trying to let my application upload a file but am getting access denied ... Prev by Date: ...
    (microsoft.public.dotnet.framework)
  • Two queries
    ... the Allocated table) I want it to display the product quantity from the ... How do I set up the query to do this? ... Prev by Date: ...
    (microsoft.public.access.queries)
  • Re: 0x800A01AE
    ... >> Everytime I am trying to update I get this error: ... >> The website has encountered a problem and cannot display the page you are ... Prev by Date: ...
    (microsoft.public.windowsupdate)
  • chcp and graftabl commande on "invite cmd".
    ... On the good work, to print i use DOSprn, and the result is correct. ... Why my display can't have the correct result. ... Alin Berenguier ... Prev by Date: ...
    (alt.os.windows-xp)
  • Re: Showing Form
    ... >reduce the problem you are facing. ... >Till your processing is going on, you can display wait cursor ... Prev by Date: ...
    (microsoft.public.dotnet.framework.compactframework)