endless do while loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xxTTcc
    New Member
    • Jun 2010
    • 1

    endless do while loop

    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_carbon ated_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.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    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.

    Comment

    Working...