RE: [PHP] Limit the amount of returns in a MySQL query
| From: | Chris Shiflett | Date: | Fri, 07 Feb 2003 21:33:02 +0000 |
| Subject: | RE: [PHP] Limit the amount of returns in a MySQL query | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134802@lists.php.net to get a copy of this message | ||
--- Chad Day <cday@atpco.com> wrote:
> if (!isset($startlimit)) {
> $startlimit = 0;
> }
>
> $endlimit = $startlimit + 10;
>
> $yourquery = "your query data LIMIT $startlimit,
> $endlimit"
>
> that should give you enough insight on how to work it.
Nice example.
As an interesting tidbit, the LIMIT clause is not standard
ANSI92 SQL and was "invented" by PHP's creator, Rasmus. So,
you can thank him for this useful clause.
Chris