Every new programmer face problem of pagination in PHP and today i have decided to give you a very easy pagination tutorial. In this tutorial i have created a class using that class you can make pagination of static records and database records.
How to use:
<?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); ?>
Download source to get paginator.class.php