Language:
oalexandrino's blog
Thursday, March 11, 2010

Blog » Generic Easy Pagination: Paging DataBase Records with PHP ADOdb


Publication Date: Thursday, March 13, 2008

Paging records came from a database is always a task that might take a good time to be completed.

You have to be aware of how you will retrieve the data and also present it in a friendly and intuitive way.

Some time ago, I wrote a class to help this activity.

It uses ADOdb Database Abstraction Library for PHP and provides to developer a fast manner to deal with the data's retrieving and presentation logic.

It can be downloaded at Class: Generic Easy Pagination where you will find a zip file that contains an example and instructions about its use.

It includes the following features:

  • Setting current page;
  • Setting the records listed in each page;
  • Setting the total number of records that were retrieved;
  • Setting the query for searching records;
  • Using the same query to gets the total number of records;
  • Defining the additional parameters that may be necessary on the search and will be passed between pages with the GET method.;
  • Outputs the total number of records;
  • Outputs the total number of pages based on to the number of records in each page;
  • Outputs the values of the records of the current page;
  • Outputs the links for browsing from 1 to 10, 11 to 20, 21 to 30, and so on.

Tagged as:

Leave a comment *:


captcha




(Click once)

* Your email address will not be published

** HTML code is not permitted

Comments

  • Class: EasyPagination
    Olavo - ( Recife, PE - Brazil) Thursday, March 13, 2008

    If you don't want use ADOdb library, you can use a version without any extra code. EasyPagination http://www.phpclasses.org/browse/package/1345.html It works just for MySQL and uses the MySQL functions such as "mysql_connect", "mysql_query" and so on.

About

oalexandrino

Olavo Alexandrino