Re: Limited number of database results
| From: | John Meyer | Date: | Wed, 13 Dec 2006 22:51:16 +0000 |
| Subject: | Re: Limited number of database results | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-42820@lists.php.net to get a copy of this message | ||
Niel Archer wrote:
> Hi
>
> use a LIMIT clause in your SQL. Something like:
>
> $query="SELECT * FROM xxxx WHERE hello = '$hello' LIMIT " . ($page - 1) *
> $rows . ", $rows";
>
> then you only need specify the logic to set the page, row and
> limitations
>
>
You also typically need to use the mod operand as well to create the
"1", 2, 3, pages.