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.

Pagination concepts

Pagination concepts - PHP Tutorial

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

Start my 1-month free trial

Pagination concepts

- In this chapter we're going to learn how to do object-oriented pagination. We will begin by talking about some of the underlying concepts that make pagination work. The reason we need pagination is to manage large sets of data. Let's imagine that instead of having just 10 bicycles in our database, we had 1,000, or even 10,000, or 100,000. We probably would not want to view all of those bicycles on a single page at one time. It would be visually overwhelming, but it also requires server to do a lot of work to retrieve that many records from the database, and then to instantiate them, and turn them into PHP objects. It would take a lot of time and a lot of memory. We probably don't want to do that. So instead, pagination allows us to just show a subset of records, and then, when we want to see more records, there are links that will take us to other pages of the results. Typically you would have previous or next to take you to the previous or next pages of results, or you might have a…

Contents