Re: Imposing a range on what is stored in a session variable
| From: | Bastien Koert | Date: | Mon, 27 Jul 2009 15:00:47 +0000 |
| Subject: | Re: Imposing a range on what is stored in a session variable | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-295887@lists.php.net to get a copy of this message | ||
On Mon, Jul 27, 2009 at 10:54 AM, Miller,
Terion<tmiller@springfi.gannett.com> wrote:
>
>
>
> =====snipped====
>>
>
> I would page the data with the LIMIT call as Jim suggested. What is
> the user doing with 1K records and how are they getting 1K records?
>
> --
>
> Bastien
>
> Cat, the other other white meat
>
>
> Here is a link to the code at PasteBin
>
> It's a db full of the town's restaurant inspections that users can look at to see
> what places have violations etc
>
> http://pastebin.ca/1504393
>
So this is a report that is being run on the data at any particular
moment in time. Is there criteria that can be used to limit the data
range for more efficient queries like:
1. must be in a certain neighborhood or zip code
You should look at paging the data here with the OFFSET portion of the
limit clause
Select * from restaurant [where clause]limit 1000, $offset
where the $offset value can tell you where to start in the 17K rows of
data so that in effect you show records 1-1000, 1001-2000,
2001-3000...then on the page, just provide a set of links of navigate
the recordset by the user [ << < 1-1000 1001-2000 2001-3000 > >> ]
--
Bastien
Cat, the other other white meat