January 5, 2024 5:01 am

How to Make PHP Pagination

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.

pagination

[wpdm_file id=20]DEMO

 

How to use:

index.php

<?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

How to create pagination in PHP and MySQL with AJAX Version 1

How to create Advance Pagination in PHP & MySQL with jQuery Version 2

Author Huzoor Bux

I am Huzoor Bux from Karachi (Pakistan). I have been working as a PHP Developer from last 5+ years, and its my passion to learn new things and implement them as a practice. Basically I am a PHP developer but now days exploring more in HTML5, CSS and jQuery libraries.


Tutorial Categories:

9 responses to “How to Make PHP Pagination”

  1. Taillandier says:

    I really like the scripts and tuts here. Well done stuff.
    The pagination class above is all fine and well but I’d say it would be more fruitful to write a tutorial about this, because coding a failsafe pagination requires some brain juice 🙂

  2. kaleem khan says:

    i not be able to download this pagination script all though i subscribe and verify email link.

  3. Matthias Müller says:

    i subscribed but cant download?

    • huzoorbux says:

      Dear @disqus_HT6PDiDzT0:disqus list update in every 18 hours thats why you are not able to download it. Now list updated please go and download.

  4. Van Peterson says:

    Please I could not download the script

  5. dev says:

    same problem.

    it will take 18 hours to upgrade subscription.
    thats bad

  6. Alexey says:

    I sent e-mail and confirmed it took more than 18 hours, you download the script thanks

  7. Sachin Sharma says:

    thanks huzoor

Leave a Reply

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