Advertisement
Virajsinh

Pagination Logic

May 27th, 2021
1,197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.19 KB | None | 0 0
  1. <?php
  2.     // https://www.petefreitag.com/item/451.cfm
  3.  
  4.     $offset = 0; $limit = 5;
  5.     if($page != "1"){
  6.         $offset = ( $limit * $page ) - $limit;
  7.     }
  8.  
  9.     $limit_cnd = "LIMIT $limit OFFSET $offset";
  10. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement