Edit
by Pranoti - 9 years ago (2015-07-29)
Divide content into pages
| I need to divide content into multiple pages. |
Ask clarification
2 Recommendations
Better PDO Pagination: Display pagination links for SQL queries using PDO
This class can display pagination links for SQL queries using PDO.
It takes a PDO object with database connection already opened and a SQL query as parameters to count the total number of result set rows.
The class can generate HTML links to browse the between the pages of the listing of results assuming a given the number of the current page, the limit number of results to display per page and a limit number of result page browsing links.
| by Dave Smith 7620 - 9 years ago (2015-08-04) Comment
Here is a highly rated class using mySQL object results from a query to return html page links. |
- 1 Comment
1.
by Manuel Lemos - 9 years ago (2015-08-05) Reply
Yes, that can be a good solution too.
The example uses MySQL, but since the connection is a parameter, it can be as well other types of databases that support the LIMIT and OFFSET clauses to define the range of rows to retrieve from the current page.
This class can show pagination of MySQL results for Bootstrap.
It extends the MySQLi wrapper to retrieve result rows for a query to a given table to display on a given page of a paginated listing.
The class can return result rows, as well HTML for the pagination links for use with Bootstrap.
| by Manuel Lemos 26695 - 9 years ago (2015-08-04) Comment
If you use the Bootstrap library, this package maybe solve your project if you are taking the content from MySQL databases. |