xip Posted February 6, 2007 Share Posted February 6, 2007 It is kinda hard to put into words so bare with me! I am building a website with the following design: table (first 30 rows of data from db) banners table (next 30 consecutive data from db) then pagination to next page with same format as above continuing to display the next consecutive set of data per table The only way I know how to do this is to set query limits (ie Limit 0,30...Limit 30,30..etc) which is real time consuming and requires lots of code because the db is very large and changes in size every day..I need some type of code that can break up my db by a specific number and output two tables per page WITH the "break" for banners... So what is a good alternative to the limit technique? Thanks! Quote Link to comment Share on other sites More sharing options...
AndyB Posted February 7, 2007 Share Posted February 7, 2007 Abstract data using a 60 record limit. Count rows outut and when you get to 30 stick in a row of banners then continue. What does any of this have to do with whether your table has 100 rows or 1000 rows. If it's "real time consuming and lots of code" it sounds as though your coding approach needs to be changed. Am I missing the point? Quote Link to comment Share on other sites More sharing options...
xip Posted February 7, 2007 Author Share Posted February 7, 2007 ya the whole reason I posted was because I know it needs to be approached differently and I'm asking how I should go about doing this...I need to have two separate tables per page...i can add in the banner myself I just don't know how to code it so it dumps it out 30 rows per table consecutively with pagination Quote Link to comment Share on other sites More sharing options...
fenway Posted February 7, 2007 Share Posted February 7, 2007 Just keep the record set in memory, and iterate though it yourself as you see fit. BTW, LIMITs with large offsets can be very slow. Quote Link to comment Share on other sites More sharing options...
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.