Paging through MySQL results in PHP
| From: | Nelson Goforth | Date: | Sat, 05 Jan 2002 01:50:53 +0000 |
| Subject: | Paging through MySQL results in PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-79513@lists.php.net to get a copy of this message | ||
I have an application that returns a set of results from a MySQL query. Let's say I have 100 results from the query, but only want to show 25 per HTML page.
The MySQL query is driven by a 'Search' page that creates an array "$keywords" - which can be of any size. I then loop through the $keywords array to create the SQL code.
I understand how to use the LIMIT statement in MySQL - so I can 'page' the output, but how do I pass the "$keywords" array with each request for the next page?
I create a link with a phrase like:
printf(...A HREF="results.php?firstitem=1&items=25&kw=$kw...);
but end up just showing that kw=array.
Can anyone put me on the right track or point me to some resource? This seems like it should be simple but...
Thanks,
Nelson