I need a bit of help with creating a trigger in mysql: I have a column named “country” and another one named “tag”.
Everytime when someone insert in the city “Los Angeles” for example, I want that my trigger to insert in “tag” column the text “is from California”.
Edit:
delimiter //
CREATE TRIGGER update_tag AFTER UPDATE ON users
FOR EACH ROW
BEGIN
IF (city = 'Los Angeles') THEN
INSERT INTO users(tag) VALUES (California);
END IF;
END;//
delimiter ;
That seems to be executed with no errors, but is not inserting anything in "tag" column, Any ideea why?
PS. I would appreciate from the ones that rated this post with "-" to write me a PM and tell me what I did wrong :). Thank you.