boionfire81 Posted June 16, 2016 Posted June 16, 2016 I found this code https://codepen.io/hackfin/pen/fyKHx I'd like to implement it instead of a pagination. Is that possible to limit results to 10 results per "wrapper" Quote
TheMasterGeneral Posted June 16, 2016 Posted June 16, 2016 Yeah. I'd assume it would be running a "while" loop while fetching rows from your database, limiting to 10 per attempt. Do I have the code for it, nope. lol. :D Quote
Dayo Posted June 16, 2016 Posted June 16, 2016 here is an example select * from test order by ID asc LIMIT 0, 10; -- gets rows 0-10 select * from test order by ID asc LIMIT 10, 10; -- gets rows 11-20 select * from test order by ID asc LIMIT 20, 10; -- gets rows 21-30 select * from test order by ID asc LIMIT 30, 10; -- gets rows 31-40 $page = (int) $_GET["page"]; $sql = "select * from test order by ID asc LIMIT ".($page * 10).", 10"; Quote
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.