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. Link to comment https://forums.phpfreaks.com/topic/116214-solved-select-from-table-skipping-values/ 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 Link to comment https://forums.phpfreaks.com/topic/116214-solved-select-from-table-skipping-values/#findComment-597586 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. Link to comment https://forums.phpfreaks.com/topic/116214-solved-select-from-table-skipping-values/#findComment-597588 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.