Re: Pagination?
| From: | Sharl.Jimh.Tsin | Date: | Wed, 09 Jun 2010 08:44:11 +0000 |
| Subject: | Re: Pagination? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-305993@lists.php.net to get a copy of this message | ||
yes,LIMIT for mysql is useful.
Best regards,
Sharl.Jimh.Tsin
2010/6/8 Ashley Sheridan <ash@ashleysheridan.co.uk>:
> On Tue, 2010-06-08 at 11:37 -0300, Paul Halliday wrote:
>
>> I just spent the last 1/2 hour looking at many different solutions for
>> this. Is there a universal favorite?
>>
>> Thanks.
>>
>
>
> It depends what you mean by pagination, as there are two parts to it.
> There is the display of the pagination nav and then the retrieval of
> paginated results:
>
> Use LIMIT in the SQL to paginate the data retrieved. I usually just use
> a few variables to determine the pagination display; $current_page,
> $items_per_page, $total_pages (which can be got by issuing a COUNT() in
> the SQL for all possible records that match.
>
> Thanks,
> Ash
> http://www.ashleysheridan.co.uk
>
>
>