PHP Techniques: Pagination
1h 11mIntermediate2021-06-15
Authors

Kevin Skoglund
Founder of NovaFabrica
Course details
Learn how to paginate a list of items or database records using PHP. In this course, Kevin Skoglund reviews the fundamentals of pagination, a helpful design pattern for breaking down large data sets into smaller, more manageable sections. He provides use cases and shows how to write the actual PHP code to find records and display a certain number per page. He then shows how to paginate records from a SQL database, add links to pages, and use object-oriented programming to define pagination functions inside a single class and create links between pages. Each chapter contains practical, hands-on programming lessons that will help you build your PHP skills.
Skills covered
PHPProgramming LanguagesOpen SourceSoftware DevelopmentOne-Off
Concepts
0. Introduction
- 01 - Showing posts in pages using PHP
- 02 - Using the exercise files on GitHub
1. Pagination Fundamentals
- 03 - Pagination overview
- 04 - Finding the pagination variables
- 05 - Using total record count
2. Database Record Pagination
- 06 - Setting up the project database
- 07 - SQL LIMIT, OFFSET, and COUNT
- 08 - Paginating database records
3. Links to Paginated Pages
- 09 - Adding links to previous and next pages
- 10 - Creating pagination links
- 11 - Showing an excerpt of the page list
- 12 - Remembering the current page
4. Object-Oriented Pagination
- 13 - Defining a pagination class
- 14 - Outputting links for previous and next pages
- 15 - Outputting pagination links
Conclusion
- 16 - Next steps