Re: PHP & MySQL Search Results
| From: | Plutarck | Date: | Sat, 14 Apr 2001 08:38:53 +0000 |
| Subject: | Re: PHP & MySQL Search Results | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-48522@lists.php.net to get a copy of this message | ||
In a MySQL query you can use the LIMIT keyword, like in phpmyadmin.
Use limit 0,10 to get the first ten results in a query.
Then do the query again but use 10,10 for the limit.
The first number is the "offset", and the second one is the maximum results
to return.
That's the way most people do "pages".
--
Plutarck
Should be working on something...
...but forgot what it was.
""Jason Caldwell"" <jason@thinkingman.org> wrote in message
news:9b8rgd$oot$1@toye.p.sourceforge.net...
> Does anyone know (or have) of a good example of how to create search
results
> like a Yahoo or MSN search?
>
> for example:
>
> Say I do a search for "cars" and there are 10,000 records in my table that
> match "car"... I would like to show the results in blocks of (say) 25 at a
> time, therefore I will need a "Next Results", "Previous Results",
> "Total
> Records found that match my query", and perhaps, between the "Previous
> Results" and "Next Results" a set of numbers like so;
>
> <Previous [1] [2] [3] [...] Next>
>
> The numbers being "jump to" links, etc.
>
> Thanks.
> Jason
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>