Adri Posted March 7, 2006 Share Posted March 7, 2006 Hey all,I heva this problem with the listing of my results. I have a lot of entries in the database and I retreieve them with:[code]$getentries = mysql_query("SELECT * FROM guestbook ORDER BY id DESC");[/code]Now, I want to show them with 15 at a time. For this I use:[code]$start = $offset (=0, 15, 30, 45, depending on which page of the results you are)$stop = $offset + 15for ($i=$start; $i<=$stop; $i++) { echo $whatever; }[/code]The problem is, that when $start=15 and $stop=30 he displays the same results as when $start=0 and $stop=15. He just always takes the first 15 results out of the array :s. How come?!? Quote Link to comment https://forums.phpfreaks.com/topic/4318-result-listing-problem/ Share on other sites More sharing options...
wickning1 Posted March 7, 2006 Share Posted March 7, 2006 Bad approach, use "SELECT * FROM guestbook ORDER BY id DESC LIMIT $start, 15" Quote Link to comment https://forums.phpfreaks.com/topic/4318-result-listing-problem/#findComment-15047 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.