Learn how to add HTML links that will navigate to the previous and next page of pagination results.
- [Instructor] Now that we have a working…pagination class and we're able to paginate…the records we get back, we need to add some links…so the user can navigate from one page to another.…And we're going to start by adding previous…and next links.…So far we have pagination, but to get…the pagination to work, we have to actually change…the URL from page one to page two…and from page two back to page one.…What we want are links that send this same URL…which are here on the page for the user to click on.…So right below the Bicycles table,…we're going to have previous and next links.…
Let's go into our code on index.php…and let's go down below the table,…and let's add some php tags, and let's start trying…to write the code that we want to go here.…Now we want to have this pagination,…but we don't always want to have the pagination.…For example, what if we had a page that…only had four bicycles on it, right?…In that case, we don't need pagination.…We don't have more than one page.…So let's wrap our code in a conditional statement.…
Note: This is an intermediate-level training course that assumes you have existing knowledge of PHP. To refresh your skills, check out PHP Essential Training and PHP: Object-Oriented Programming.
- Creating a project database and tables
- Connecting to the database
- Database queries with OOP
- The active record design pattern
- Defining a database-driven class
- Performing common database tasks with OOP
- Creating inheritable and reusable code
- Object-oriented user authentication
- Object-oriented pagination
Skill Level Intermediate
Consuming RESTful APIs in PHP with Guzzlewith Justin Yost2h 12m Intermediate
PHP: Accessing Databases with PDO and MySQLiwith David Powers3h 47m Intermediate
1. Overview and Project Setup
2. The Database Connection
3. Define a Database-Driven Class
4. Object-Oriented CRUD
5. Object-Oriented Authentication
6. Object-Oriented Pagination
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.