jack.johnson.87 Posted January 17, 2007 Share Posted January 17, 2007 i don't have any experience with writing php but we use this line in the browser window, so I'm hoping that someone here can help:www.mysite.com/admin/user.php?action=Modify&ID=1234That pulls up one record, but sometimes I want to look at a range like 1229-1234. Is there a way that line can be formatted to display the range?Thanks,JJ Link to comment https://forums.phpfreaks.com/topic/34612-getting-a-range-of-records/ Share on other sites More sharing options...
RobinTibbs Posted January 17, 2007 Share Posted January 17, 2007 perhaps have two variables in the url with the start and end of range and use those, as so[code]htttp://www.mysite.com/admin/user.php?action=Modify&minID=1&maxID=56[/code]then (in psedocode, my mysql is a little rusty)[code]SELECT * from <table> WHERE id >= <minId> & id <=>maxID[/code]just a thought :) hope it helps Link to comment https://forums.phpfreaks.com/topic/34612-getting-a-range-of-records/#findComment-163079 Share on other sites More sharing options...
dgiberson Posted January 17, 2007 Share Posted January 17, 2007 Robin's code will work, here is an alternative:SELECT * FROM table WHERE < condition statements here>ORDER BY <whatever>LIMIT 1229, 5 Link to comment https://forums.phpfreaks.com/topic/34612-getting-a-range-of-records/#findComment-163112 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.