I'm using PHP/MySQL. I'm creating a ecommerce site and i've done the shopping cart and the order system (i.e. checkout process). I have a products table that contains a attribute called 'unitsavailable'. What i want to do is every time a person makes a purchase i want to decrement the value inside the attribute 'unitsavailable' for the specific product sold so that until it reaches 0 the system can recognise that there are no more left. If anyone can help i would apreciate it very much.
Thanks for the reply. I know how to decrement in accordance to the example you provided, but i'm trying to change the value of the stock level in my database products table after the customer completes their checkout process. Example when the customer clicks buy the value of the units in stock will change depending on the amount purchased.