Jump to content

Display array in multipule pages


danscreations

Recommended Posts

I have an array that prints results out on the page but was curious if anyone knew how to specifiy a certain amount of records to print before creating a link to page two which would specify to display the next set of records.

 

Example:

- data file contains 25 records

- want to display 10 records per page

 

page 1: print records 0 thru 9

page 2: print records 10 thru 19

page 3: pring records 20 thru 24

 

obviously needs be based on a varible so that  if they're are only 7 records or 48 it will figure out how many pages need to be created/displayed.

Link to comment
https://forums.phpfreaks.com/topic/120721-display-array-in-multipule-pages/
Share on other sites

Count the number of records.

Divide by the number of records to show on each page to get the number of pages: use ceil();

Use the array offsets to determine which value to start at and end with for each page.

The URL parameter to determine the page could be the starting offset.

 

Work with that.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.