menu

Monday, 8 April 2013

How to Make Pagination in PHP

I am trying to solve problem of pagination in PHP. I have decided to give you a very easy pagination code
You can make pagination of static records and database records.
<?php
/**
*$num_rows =  First make a query to get the number of the results
*/
$num_rows = 50;
include('paginator.class.php');
$pages = new Paginator;
 
echo'<pre/>';print_r( $pages->getPaginateData($_GET['page'],$num_rows) );
echo $pages->displayHtmlPages($_GET['page'],$num_rows);
?>