Re: 2 times same query, once with limits
From: Erwin Moller (since_humans_read_this_I_am_spammed_too_much_at_spamyourself.com)
Date: 01/21/05
- Next message: John Dunlop: "Re: php perl dumb question"
- Previous message: Erwin Moller: "Re: php perl dumb question"
- In reply to: Bob Bedford: "2 times same query, once with limits"
- Next in thread: Bob Bedford: "Re: 2 times same query, once with limits"
- Reply: Bob Bedford: "Re: 2 times same query, once with limits"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 21 Jan 2005 17:45:29 +0100
Bob Bedford wrote:
> I've a query quite important to execute.
>
> I've to fill an array with all result, so the query is called once wich
> returns all ID's
>
> Then I call the same query a second time as I shown only 10 results in my
> page.
>
> How can I avoid to call the query twice ?
>
> Bob
Hi Bob,
you didn't mention if you want to use both results on the same page.
If so:
- Loop over ALL the results once.
- Then loop over the first 10
If you want the results to be available on another page, store them in a
session.
Regards,
Erwin Moller
- Next message: John Dunlop: "Re: php perl dumb question"
- Previous message: Erwin Moller: "Re: php perl dumb question"
- In reply to: Bob Bedford: "2 times same query, once with limits"
- Next in thread: Bob Bedford: "Re: 2 times same query, once with limits"
- Reply: Bob Bedford: "Re: 2 times same query, once with limits"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|