Jump to content

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.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.