![]() Join Up! 96817 members and counting! |
|
|||
Building Next/Prev Buttons for Query Results
Rod Kreisler
There have been numerous requests on the Support Forums recently
asking how to do "NEXT 1 2 3 4 5 PREV" type links from a search
result. I hope the following script will help you add this
functionality to your search result pages. This example is
written for MySQL but can be adapted quite easily to other
SQL engines.
Since each application is different I've used some generic
statements for the MySQL queries. TABLE should be replaced
with your table name. YOUR CONDITIONAL HERE should be replaced
by your where conditions and WHATEVER should be replaced by the
column you wish to order your results (don't forget to add DESC
if applicable to your needs).
That should do the trick for you. Of course, you'll probably want to
clean up the HTML output...
Also, note that the links to
$PHP_SELF only include the $offset.
If you need to pass parameters for the where conditional of your query, you'll
need to tack those on as well.
--Rod
|