Or should that be Nicr? To follow in an annoying theme.

Olavo Alexandrino wrote a nice well rounded class for record set pagination in ADOdb. If you’ve ever used ADOdb’s version, you will know it is not very good, to say the least.

Although Olavo did a fantastic job on the logic, the presentation left a little to be desired from my perspective.
I am providing my modifed version for download below, it provides a few logic updates and better presentation.

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.

It has been tested on MySQL version 3.23.56-nt, Microsoft SQL Server 2000 and Microsoft Access 2002 by Olavo and on MySQL version 5 by myself.

example.JPG

Download, download, download;

It uses some icons I created stole from Mark James of Fam Fam Fam fame.