Is there a reason why ORDER BY LIMIT not working inside a foreach loop? in PHP Coding Help Posted June 15, 2017 · Edited June 15, 2017 by mannyson So I have a much simpler solution. The whole reason I wanted to find a new method for 3 loops is because I wanted to have a load more button. Unfortunately that only works if the last loop is has LIMIT set. Having said that I just found a better solution. I can still keep my original 3 loops to retrieve records. But instead of having hundreds of records load directly on the page, I can have a mini vertical scroll in the css table(overflow:scroll;). I know the page load time will be the same but atleast it'll be a much easier way to look at the records for mobile users. Instead of them keep scrolling the page itself, they will scroll the table itself instead.