JustGotAQuestion Posted April 24, 2008 Share Posted April 24, 2008 I want to make a page that calls 10 results from a database, one after another. I want page numbers at the bottom (if there are more than 10 results) so that clicking page [2] will give you the next 10 results. I know this has got to be a very common thing to do, so if you don't feel like explaining, can you link me to a good tutorial? Thanks Quote Link to comment Share on other sites More sharing options...
Spaceman-Spiff Posted April 24, 2008 Share Posted April 24, 2008 The key is using LIMIT x, y - where x is the row start, and y is the row amount per page. Example: - for page 1: SELECT * FROM tablename LIMIT 0 , 30 - for page 2: SELECT * FROM tablename LIMIT 30 , 30 - for page 3: SELECT * FROM tablename LIMIT 60 , 30 Quote Link to comment Share on other sites More sharing options...
JustGotAQuestion Posted April 24, 2008 Author Share Posted April 24, 2008 Nice! So I'll play around with that for a while. Sounds like thats all I need to get started. Thanks. Quote Link to comment 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.