By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,743 Members | 1,266 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,743 IT Pros & Developers. It's quick & easy.

endless do while loop

P: 1
Hello all!

Well I have unusual question I think. I am making a web site and the products must be shown as a line I will past a link for better understanding.

http://partyclub.mdkbg.com/products_carbonated_mix.html

Clicking the bottle in the right will change the products to the next. But if you keep clicking will see that when the end of DB rows is near the the small 3 bottles in the left are disappearing. So I am asking is there a way tom make them start over from ID 1 after the last DB query.

Thank you very much.
Jun 10 '10 #1
Share this Question
Share on Google+
1 Reply


Banfa
Expert Mod 5K+
P: 8,965
You are presumably getting the results based on the first ID you want to display.

You need to try doing one of these 2 things
  1. Always get all the results and pick out the right ones using php. This will be fine if you only ever have a handful of results but may be a problem if you are only displaying 4 of 1000 items.
  2. Modify your query when you are close to the end of the table to add the first few results from the beginning (or always added them) again using php to pick out the correct ones to display. This would reduce the result set size if picking out 4 items from 1000s

I think you will have to do some of this with php, I do not think you can modify your SQL query to get all the result in the right order.
Jun 10 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.