Help: the trigger updates the table data

A name password
B name password
Table two the name Association
Write a trigger.
When the A table update password, password B table update
Prawns do me a favor.

Started by Todd at November 22, 2016 - 9:59 AM

CREATE TRIGGER testref BEFORE INSERT ON A
FOR EACH ROW BEGIN

UPDATE B SET `password`=NEW.`password`;
END;

Posted by Sonia at December 07, 2016 - 10:09 AM

Update: Oh, these 2 tables are the original, is when the user to modify the password is changed, the A table, then the B table to the synchronous change

Posted by Todd at December 08, 2016 - 11:08 AM

DELIMITER $$

CREATE TRIGGER `aa`.`AA` BEFORE UPDATE
ON `aa`.`AA1`
FOR EACH ROW BEGIN
UPDATE AA2 SET `password`=NEW.`password` WHERE NAME=NEW.NAME;
END$$

DELIMITER ;

Posted by Sonia at December 09, 2016 - 11:58 AM

Posted by Todd at December 21, 2016 - 12:09 PM

CREATE TRIGGER tr_A AFTER UPDATE ON A
FOR EACH ROW
UPDATE B SET `password`=NEW.`password`;

Posted by Cliff at December 22, 2016 - 1:03 PM