Re: Previous & Next Navigation
| From: | 1LT John W. Holmes | Date: | Mon, 03 Jun 2002 18:56:36 +0000 |
| Subject: | Re: Previous & Next Navigation | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-100449@lists.php.net to get a copy of this message | ||
So you think it's more efficient and faster to load a 3 - 5 thousand row
table into an array in memory and pass that around to all of your scripts
(through sessions?), rather than just passing a $page variable and doing a
query to return 30 rows on each page??
If you pass a $Page variable, you can make your query like this:
SELECT * FROM table LIMIT $Page*30,30
Just increment and decriment $Page as you traverse the results...easy, eh?
---John Holmes...
----- Original Message -----
From: "Jay Blanchard" <jay.blanchard@niicommunications.com>
To: <php-general@lists.php.net>
Sent: Monday, June 03, 2002 1:06 PM
Subject: [PHP] Previous & Next Navigation
> Howdy!
>
> I am working on a project where approximately 3k - 5k records are returned
> and need to be displayed 30 per page with 'previous' and 'next' navigation
> at the request of the users. Does anyone know of an efficient script that
> will do this in PHP (with MySQL) that will not query the database every
> time? I would like to place the records into an array after one query to
the
> database and then navigate the array...both for efficiency and speed.
>
> Anyhow, if anyone knows, please let me know. Otherwise I will have to
write
> what I am looking for, and I really have no desire to re-invent the whell
on
> a Monday afternoon.
>
> TIA!
>
> Jay
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>