My MySQL table looks as follows:
Item_Id Item_Name quantity
1 HPWT 20 20
The quantity field is an integer.
Now, if I bought this "HPWT 20" item again with quantity "5" , I want my table affected as follows:
Item_Id Item_Name quantity
1 HPWT 20 25
What I always do is: first I select the previous quantity from the database, then add new quantity to it, then update the quantity with new one at the desired Item_Id.
Is there another (direct) way to Update the quantity?