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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.