質問

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.

役に立ちましたか?

解決

You can copy the pagination logic from here

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top