proggR Posted July 23, 2008 Share Posted July 23, 2008 Without adding a second ID to determine the entry number based on another column, is there anyway to skip a certain number of values based on which page is selected? I'll have keywords setup saved in the column 'keyword' and i want to SELECT FROM table WHERE keyword='Something' But if its page one i want it to take the first 5 entries that fit that description and if its page 2 i want it to select the next 5 etc. Is there anyway to do this quickly? I have a few ideas but I want to know if I'm putting too much work into it Thanks in advance. Quote Link to comment Share on other sites More sharing options...
accident Posted July 23, 2008 Share Posted July 23, 2008 I am not 100% sure I get what you are saying, but what I think you want to use is LIMIT So for page one you would do SELECT whatever FROM table WHERE keyword='Something' LIMIT 5 This will return only the first 5 results For second page you would do SELECT whatever FROM table WHERE keyword='Something' LIMIT 5,5 This will start at the 6th row and return the next 5 rows.. So row 6-10 Quote Link to comment Share on other sites More sharing options...
proggR Posted July 23, 2008 Author Share Posted July 23, 2008 Thank you, that's exacly what I meant. 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.