paginated query results
Posted: Wed Sep 13, 2006 5:21 pm
I have a basic cart that outputs a table based on one of 3 user queries - keyword search, main category or sub category. Those are inputted to the cart through the URL from links and would be cleaned $_REQUEST variables.
Currently that could yield 144 results, which looks amateurish!
If I want to paginate the results so there aren't two many.
My thoughts
Option 1) $_REQUEST variables containing the original query and pagination variables...
Do the query
Work out how many rows
Work out how many pages
Check what page no from, default to 1
Create Page no links
Output current page of results
Option 2) use Session variables to do the same
Option 3) ????
What is the best way to do it?
Currently that could yield 144 results, which looks amateurish!
If I want to paginate the results so there aren't two many.
My thoughts
Option 1) $_REQUEST variables containing the original query and pagination variables...
Do the query
Work out how many rows
Work out how many pages
Check what page no from
Code: Select all
$_REQUEST['pageno']Create Page no links
Output current page of results
Option 2) use Session variables to do the same
Option 3) ????
What is the best way to do it?