MySQL Trigger to prevent INSERT under certain conditions
- by Richard Mar.
I want to make a trigger that will prevent the insertion if the birthdate (one of the columns) is in the future. I have this:
CREATE TRIGGER foo
BEFORE INSERT ON table
FOR EACH ROW
BEGIN
IF NEW.birthdate > CURRENT_DATE()
THEN
???mystery???
END IF;
END;
What goes in the mystery part?