I want to update Item quantity while database set check that quantity>0. how to cancel all the queries if one of them not success to update (0 row affected) ? using mysql/mariadb, php
UPDATE `item`
SET `quantity` = quantity+100
WHERE `item`.`itemid` = '0001';
UPDATE `item`
SET `quantity` = quantity-100
WHERE `item`.`itemid` = '0002'; --fail to update