Jump to content

Pagination of results from PHP/MySQL: what is the best method?


lovelycesar

Recommended Posts

I would like to know what is the best method (the most intelligent and comfortable for users) to paginate a result table with PHP/MySQL?

Provided I have a result set of 100 pages.

 

Method 1:

<select>

<option>1</option>

....

</select>

 

Method 2:

Link on Page 1, 2, 3 ... 100

 

If there is any algorithm with PHP for automated these displays, please demonstrate it.

Last night I implemented this: http://www.sitepoint.com/perfect-php-pagination/ into my design. I like how it fetches results from the database only once and the rest is handled by the logic. It isn't fancy and you should be able to work out a much better interface in an hour or two if that's your thing, but I found it very straightforward and easy to implement.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.