|
Posted by Andy Jeffries on 06/22/06 08:04
On Thu, 22 Jun 2006 01:00:32 -0700, Sjoerd wrote:
>> Now i'd like to implement a page function to separate 1000 records into
>> 20 pages.
>
> Add a LIMIT clause to the query.
> First page: LIMIT 0, 20
> Second page: LIMIT 20, 20
> and so on.
>
> http://dev.mysql.com/doc/refman/4.1/en/select.html
But remember this won't work if you do an ORDER BY RAND() on each query
(as the information on each page won't be consistent, you will get records
you've already seen reappearing on latter pages).
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Navigation:
[Reply to this message]
|