I have a situation in which I want to update a the second table when a row of data is inserted in the first table. To achieve this I am using mysql triggers and below is the query I am using, but its not working for me.
DELIMITER $$
CREATE TRIGGER after_insert;
AFTER INSERT ON table_first
FOR EACH ROW BEGIN
INSERT INTO table_second
(value1, rvalue2, value3)
VALUES
('123456', '654321', 'hello trigger')
END
DELIMITER ;
Both the tables exists in the same database.
Thanks
Some small syntax problems … here :