remybink Posted July 28, 2011 Share Posted July 28, 2011 I see so much about pagination, but what is it called or what is the function to create a "break" after "x" amount of results? I am going to sit here until this website is complete, times are tough and I must launch a better website. Thank you for any help you guys can and did offer. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 28, 2011 Share Posted July 28, 2011 in your mysql query, do "SELECT something FROM somewhere limit 20" // for only 20 results. On the next page you need to pass the last result you got, and the query becomes "LIMIT startingNumber,NumberOfRecords". Quote Link to comment Share on other sites More sharing options...
remybink Posted July 28, 2011 Author Share Posted July 28, 2011 I don't want to pass it to the next page I want the result on the same page so line 1) 5 products line 2) break of some sort line 3) 5 more products etc Thank you for your input, I will practice with the limit function anyway Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 28, 2011 Share Posted July 28, 2011 Then just implement that in your code that processes the results $group_records = 5; $recordCount = 0; while($row = mysql_fetch_assoc($result)) { $recordCount++; //Display the record if($recordCount%$group_records == 0) { //Display something between each group of records } } Quote Link to comment Share on other sites More sharing options...
remybink Posted July 28, 2011 Author Share Posted July 28, 2011 Thank you very much. I'll try this later. Seems too involved for right now. would require me to move too many items around. I have my echo's as the last instructions. I'll try it tonight. Quote Link to comment Share on other sites More sharing options...
Psycho Posted July 28, 2011 Share Posted July 28, 2011 Too involved? That's about as easy as it gets. Show the code you currently have to display the records and provide the code you want displayed between each group of records and I can provide more help. 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.