I want to create a trigger, and I wrote this request, but it is not executed. Please check my request
CREATE TRIGGER 'blog_after_insert' AFTER INSERT ON 'blog' FOR EACH ROW BEGIN IF NEW.deleted THEN SET @changetype = 'DELETE'; ELSE SET @changetype = 'NEW'; END IF; INSERT INTO audit (blog_id, changetype) VALUES (NEW.id, @changetype);
I get this error
source share