EchoFool Posted July 8, 2008 Share Posted July 8, 2008 I have the idea of a while loop with a query which is also in a while loop.. so in essence a while loop within a while loop. Now obviously that is do-able but the first main query i need to select rows in batches of 3's via ID for example. $Get the first 3 While($row = ($Get)){ $row['ID'] $Find info on $row['ID'] While($row2 = ($Find)){ // stuff here } Now what needs to be added is a while loop around that whole thing so the "$Get the first 3" will essentially do this: Get first 3 Get 4 to 6 Get 7 to 9 etc But could not figure out how I could do this..... any suggestions? Link to comment https://forums.phpfreaks.com/topic/113830-help-with-while-loop-idea/ Share on other sites More sharing options...
gigas10 Posted July 9, 2008 Share Posted July 9, 2008 select * from table order by asc limit 3 select * from table where id > 3 order by asc limit 2 why would you even want to do this? Link to comment https://forums.phpfreaks.com/topic/113830-help-with-while-loop-idea/#findComment-584971 Share on other sites More sharing options...
bluejay002 Posted July 9, 2008 Share Posted July 9, 2008 yeah... you can do this with query through LIMIT Link to comment https://forums.phpfreaks.com/topic/113830-help-with-while-loop-idea/#findComment-584981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.