Best way to do multiple page search results

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
slimsam1
Forum Commoner
Posts: 49
Joined: Wed Aug 21, 2002 12:20 am

Best way to do multiple page search results

Post by slimsam1 »

Let's say I have a rather large database, with many rows, and let's say that searching can yeild up to 200 results. How should I go about splitting these results into different pages, and have a list of page numbers?

example:

186 results for "Blue". Viewing page 3 of 5.
<-- previous ( 1 2 3 4 5 ) next -->

I've managed to do the previous and next page links, and it works great.... but with a large database, it can get slow because it does the query all over again, only printing the results for the page being viewed.

Ideas?
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

This should give you a start:

Ref : http://www.devshed.com/Server_Side/PHP/ ... page1.html
Post Reply