i have an array that displays a number of images that the user has searched for, i want to only display the first 3 images and then have the others on the next page and so on, can anyone help?
thanks g
help with limiting results shown
Moderator: General Moderators
-
godonholiday
- Forum Newbie
- Posts: 7
- Joined: Mon Feb 07, 2005 3:12 pm
- Location: liverpool
-
magicrobotmonkey
- Forum Regular
- Posts: 888
- Joined: Sun Mar 21, 2004 1:09 pm
- Location: Cambridge, MA
what you're looking for is pagination. You can search these forums for that word and find plenty of help. Basically, what you need to do is have some way to remember where you are in the result set as you move from page to page. If you are pulling results from a mysql db, you can use LIMIT to only pull the results you want. If all you have is an array, but you know enough about the indeces of it, you can manually pull a different chunck of it on each page.