phpmysqlactiverecordpaginationindicator

PHP paging show page indicator


I have lookup many similar script but didn't work

There's current code

<?php
   $LimitPerPage = 3;

   $CurrentPage = 1;
   if(isset($_GET['p'])){
      $CurrentPage = $_GET['p'];
   }

   $PageOffset = ($CurrentPage - 1) * $LimitPerPage;
   $image = imagedb::find_all_by_owner($email,array('limit' => $LimitPerPage,'offset' => $PageOffset));
   $TotalPage = ceil(count($linkerimage)/$LimitPerPage);

   if(!is_null($image)){
    // ..show image code
   }
?>

How can I develop a navigation bar for switching page?

Eg. Prev [1] [2] [3] [4] ... [64] Next

Bold is current page.


Solution

  • You can copy the pagination logic from here