Im trying to have trigger that when seats value is inserted is must be less than 31, the triggers doesn't work for some reason .. any help will be great as I tried other solutions but din work well
delimiter |
CREATE TRIGGER seats_check BEFORE INSERT ON booked
FOR EACH ROW
BEGIN
if (new.seats_booked <=30)
THEN INSERT INTO booked set seats_booked= new.seats_booked;
ELSE
INSERT INTO booked set seats_booked=0;
end if;
END;
|