PHP Pagination Class – Version 3

It’s been a while since the popular PHP pagination class has received any of my attention, so a few months ago I set out to re-write the class to be more up to date. This version takes advantage of both code and security updates as well as updates to PHP and MySQL. I’m also planning on moving the code over to GitHub where it should be easier to manage.

Here is the new and improved PHP pagination class for your enjoyment:

Download

See the example files for how to use. I’ll create step-by-step instructions shortly.

Demo

Note that the demo uses MySQL’s free “world” database available at http://dev.mysql.com/doc/index-other.html

  • Example 1 (basic paginated database result set)
  • Example 2 (Form variables passed via pagination class)

35 thoughts on “PHP Pagination Class – Version 3”

  1. Has anyone tried styling the links? I can do the majority but am failing at “previous”, “next” and “current” link. I would also like to style the drop down, but don’t quite know how the links at put together.

  2. hi, i’ve been using your pagination for a while and it was great, problem occured after i upgraded to PHP 7.1
    it says , “Warning: A non-numeric value encountered in paginator.class.php on line 81″,
    which is ” $this->limit_start = ($this->current_page current_page-1) * $this->items_per_page; “.
    so i assumed there is string variable on there (in this case is “All” for items_per_page).
    my workaround for this issue is adding intval so the code on line 81 become like this,

    $this->limit_start = ($this->current_page current_page-1) * intval($this->items_per_page);

    hope this help guys and the devs could make another great version of this.

Leave a Reply

Your email address will not be published. Required fields are marked *