I'm trying to create a trigger where if someone says they have a discount code, the purchaseprice of their ticket drops by $10.
I ran the code:
CREATE TRIGGER alterPurchasePrice AFTER INSERT ON CustomerOrders FOR EACH ROW
BEGIN IF DiscountCode = 'yes' THEN SET PurchasePrice = Cost - 10 END$$
But got the error:
#1193 - Unknown system variable 'PurchasePrice'
However, I have that column in my table. So I don't understand why it's not recognizing it?