Page Numbering problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GaRd3NiA
Forum Newbie
Posts: 2
Joined: Tue Sep 11, 2007 10:48 pm

Page Numbering problem

Post by GaRd3NiA »

Hi, i m now working on a page numbering function. i have go through quite a lot of the examples from google but none of them do what i need. Below is my case:
I have, for example an array holding 132 values, and i wan to show only 5 items in a page, so there is a total of 27 pages.The page number then will show something like below,
Page 1 2 3 4 5 > >> , when we click on ">" it will show
Page < 6 7 8 9 10 > >>, click on ">" again, it will show
Page << < 11 12 13 14 15 > >>, and so on. click on "<<" or ">>" will bring to the first and last page.

Any idea on how to make this thing happened? Thanks...
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: Page Numbering problem

Post by aceconcepts »

What did you search for using Google?

This is known as "pagination". Try searching using this term - there are lots of tutorials out there.

In brief, what you'd need to consider is number of results per page, LIMIT 0, 5 and url parameters.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Page Numbering problem

Post by Christopher »

I posted some links here that contain more links:

viewtopic.php?p=561007#p561007
(#10850)
User avatar
juma929
Forum Commoner
Posts: 72
Joined: Wed Jun 17, 2009 9:41 am

Re: Page Numbering problem

Post by juma929 »

Hello,

Are you using a database or just a hard coded array of a certain number of items?

Thanks :)
Post Reply