Re: limiting rows and pages like google -- again
| From: | David Robley | Date: | Thu, 13 Sep 2001 05:58:06 +0000 |
| Subject: | Re: limiting rows and pages like google -- again | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-67145@lists.php.net to get a copy of this message | ||
On Thu, 13 Sep 2001 14:55, Adrian D'Costa wrote:
> Hi,
>
> I am trying to find out the the best way to do the following:
>
> I have a script that select records from a table. The problem is that
> I need to limit the rows to 20. I know that I can use limit 20. But
> what I want to do is give the view a link to the next 20 till all the
> records are shown. What I don't know is how to maintain the search
> query and I want to use the same script.
>
> The logic would be to check if the script is called the first time,
> then the sql statement would be select travel.*, city.city from travel,
> city where travel.cityid=city.id limit 0,20.
> The second time or based on what has been selected on the page (1-20,
> 21-40, etc) add that to the sql statement. My question is how?
>
> Can someone guide me or give me some example.
>
> TIA
>
> Adrian
This has been a common topic recently. Try the archives
http://marc.theaimsgroup.com/?l=php-general&r=1&w=2&q=b&s=pages+like+google
--
David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA
Useless Invention: Flashbulb tester.