Hi I have a table in my database for product discount which looks something like this:
id product quantity NewPrice
On my website in php at the moment:
for each row:
Price per unit when buying $quanity or more: $NewPrice
But what I would like is:
Price per unit when buying $quanity1-$quanity2: $NewPrice1
Price per unit when buying $quanity2-$quanity3: $NewPrice2
Price per unit when buying $quanity3 or more: $NewPrice3
So basically I would like to take the quanity-value from two different rows to make up the text for the price from the first row.
If that makes sense?
Order the results by product, quantity and then loop over the results and compare with the previous row: