I'm developing a Wordpress site. I'm trying to insert a new row into a table when new row with specific value in usermeta table is added. This is what I got for now:
DELIMITER | CREATE TRIGGER user_sub AFTER INSERT ON wp_usermeta FOR EACH ROW BEGIN IF meta_value='subscribe' THEN INSERT INTO newsletter_user_list SET list_id = 1,user_id=NEW.user_id; END IF; END; | DELIMITER ;
But this breaks the usermeta table. After new user register usermeta table is not populated.Thank you very much for any help because I have no experience with triggers.