Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Simple PHP Pagination Reply To: Simple PHP Pagination

#180494
__
Participant

the pagination will be for the all categories page, and about 10 other pages each being a different movie genre like action/adventure, comedy etc.

Do they select from different database tables, or all from the same table?

I’d start with two functions:

  1. a function to determine the desired offset, based on the current page and the desired results per page
  2. a function to write HTML markup for a collection of pagination links

The first is very simple — it’s basically just wrapping the code I showed above into a function. For the second function, you will need to decide what sort of finished HTML you want for the pagination links.