Trigger stock phpmyadmin

This article is tagged with: Trigger stock phpmyadmin and mysql

trigger stock phpmyadmin

DELIMITER $$
CREATE TRIGGER invlevel_AUPD
AFTER UPDATE ON invlevel
FOR EACH ROW
BEGIN
IF NEW.quantity < 20 THEN
INSERT INTO orders (productid, amount)
SELECT productid, amount
FROM reorder
WHERE productid = NEW.productid;
END IF;
END$$
DELIMITER ;

This article is tagged with: Trigger stock phpmyadmin and mysql