How do I make this sqlite trigger compatible with MYSQL, I have never used triggers with MYSQL and I'm confused.
CREATE TRIGGER IF NOT EXISTS update_this AFTER INSERT ON this
BEGIN
UPDATE `another` SET `something` = `something` + new.number;
END;
Solution :
delimiter |
CREATE TRIGGER update_this AFTER INSERT ON this`
FOR EACH ROW BEGIN
UPDATE `another` SET `something` = `something` + NEW.something WHERE `id`= NEW.id;
END;
|
delimiter ;