From the course: PHP: Object-Oriented Programming with Databases

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Paginate bicycles

Paginate bicycles - PHP Tutorial

From the course: PHP: Object-Oriented Programming with Databases

Start my 1-month free trial

Paginate bicycles

- [Instructor] Now that we've defined our pagination class, we're ready to use that class to help us to paginate our bicycles. So where we left off in the last movie, was we had added this pagination class in here, but it's not going to work yet and the reason why is because we're parsing in arguments that don't exist, current page, per page and total count. We need to find those values. I'm just going to copy those and let's go up here and for each one of these, we know we need to figure out what the value's going to be equal to. Current page, per page and total count. So current page, we're going to get that from the URL. The idea is that when we click on one of the links that will eventually take us to the next page or jump to a page, it's going to be the same URL as what's up here now, but it'll add a query parameter to it that looks like this. Page equals two. What we want to do is be able to grab this value from the URL and use that as the page. So let's go back over here. We…

Contents