In our cart process we don't want to remove items from the store inventory until after the payment gateway has returned a approved code for the credit card purchase. Thus assuming the payment was approved we need the cart items to deduct from the inventory.
In a mysqli UPDATE query how if possible can i write it so that the new value being set is the result of the rows current value - the quantity stored in the carts Item_qty field?
mysqli_query($con,"UPDATE table1 SET Qty='`**current-value**` - $proc[Item_Qty]' WHERE buyer='$user'");
I do understand that I can accomplish this using multiple queries, perform some math and then write the value back to the database, but I am hoping there is a cleaner way with less code by doing all in a single mysqli query.