Reply to Re: How could I paginate the result set?

Your name:

Reply:


Posted by Tyno Gendo on 04/19/07 09:44

Man-wai Chang wrote:
> I would like to do something like this:
>
> select * from myTable where ... pagesize 10 page 1
>
> How could I do it elegantly in:
>
> 1. PHP+MySQL before MySQL 5 (without stored procedures)
> 2. MySQL alone (with stored procedures)
>

Take a look at LIMIT in MySQL, and use a page offset variable in your PHP.

I usually do two queries, one to get how many results there would be
without pagination, and another to get the results within the page range.

Don't know if this is the best way to do it though, i'd be interested in
others replies myself.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация