Edit
by rafi randoni - 10 years ago (2015-01-15)
Pagination for MySQL queries
| I need to query a MySQL database and show links to pages of the results listing. |
Ask clarification
2 Recommendations
PHP Array Paging: Generate pagination links for listings in an array
This class can generate pagination links for listings in an array.
It takes a list of items to display in an array and generates links to browse the the previous and next pages that will list the items.
The current page number is retrieved from a request parameter. The limit number of items to display per page is configurable.
| by rafi randoni package author 10 - 10 years ago (2015-01-25) Comment
please check example.php first, you'll find out, how it is deadly simple to use... |
Auto Pagination: Generate listing pagination links
This class can generate listing pagination links.
It takes as parameters the number of listing entries to display per page and the current page number.
The class generates HTML links to go to other pages like the next page, previous page and any intermediate pages.
| by Nitesh Apte package author 125 - 10 years ago (2015-01-19) Comment
It's a generic implementation. The total number of records fetched from MySql table need to be passed as first parameter. Please check example.php
<?php
include_once 'class.AutoPagination.php';
$obj = AutoPagination::getInstance();
echo $obj->paginateRecords(50, $_GET['page']); // 50 is the total record count selected from mysql database
?> |