Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- newbie: page state with php?
June 10, 2006, 6:31 pm
rate this thread
Let's say there are 12 items, and only 3 at a time can be displayed on a single
So the user needs to see some king of navigation control (a simple link would
suffice) that tells him there X items ahead and Y items behind. This way he can
page through all 12 items, 3 at a time, moving forward and backward.
Does this require some king of page/session state? How will my code know if
items 1 through 3 or 6 through 9 are currently displayed?
My guess is I'm not the first one who has needed to solve this kind of problem.
Can anyone point me in the right direction? Code examples would be great...
Thanks in advance.
Re: newbie: page state with php?
On your query:
Try using LIMT on SELECT statement.
$end = $start + $limit;
//Set your query like this for example.
$query = "SELECT * FROM items LIMIT "."$start"." , "."$end";
//display your HTML result;