i want to be abale to update the filed 'activated' to 0 when the 'expireDate' is before today.
can you show me how to do it with a trigger? (i want to do this after the user insert the row)

i want to be abale to update the filed 'activated' to 0 when the 'expireDate' is before today.
can you show me how to do it with a trigger? (i want to do this after the user insert the row)

i keep getting a syntax error on phpmyadmin

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 5
CREATE TRIGGER expierd
AFTER INSERT ON outlet
FOR EACH ROW 
BEGIN 
UPDATE outlet SET activated = 0 WHERE now() >= `expireDate`;
END;$$
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.