Expand|Select|Wrap|Line Numbers
- UPDATE items i, cartitems c
- SET stock = (stock-1)
- WHERE i.id = c.itemid AND c.userid = '7';
The code above, will unfortunately only decrement a maximum of once in stock per different item.
Any help would be greatly appreciated, and please don't suggest to add quantity fields to the 'items in shopping cart' table as this not an option.
Cheers, J