Forum Moderators: coopster
I’m trying to create a query to display search results from a table in my MySql database that will return 4 results for each page shown.
Each item in the database has been assigned an automatic number so the latest item added has the highest number. The search results for the fist page need to start from the newest entry (the one with the highest number) and descend. The next page needs the query to start from the last item in the previous page query. Also the another problem is, the user has the option to remove items from the database so the numbering is not-consecutive as it descends.
i.e.
10, 9, 7, 6, 5, 4, 2, 1,
Numbers 8 and 3 are missing, so results for page one need to be = 10, 9, 7, 6,
Results for page two need to be = 5, 4, 2, 1
Thanks in advance, as I’ve been messing all day and can’t come up with a solution.
then have your sql statment select all with the order by desc
use a loop to echo off your 4 for each page and pass the counter (so you know where you left off ) in the $count variable.
I've never tried to pass results in a url before so i don't know if this will work.