Request for admin to explain the below sql for setting trigger in MySql DB.
I have tried to understand/decipher the sql below by looking at Template Cars, the tables created at db has no tables which helps me to understand the sql.
table at db = carscars however the db is named: cars
delimiter |
CREATE TRIGGER insert_encrypt BEFORE INSERT ON cars <<<<<<< what does cars equal? The database name ?
FOR EACH ROW BEGIN
SET NEW.Model = AES_ENCRYPT(NEW.Model,"my passphrase"); <<<<<<< what is NEW.Model ? a new table to be created? an existing table in db? a fieldname in some table?
END;
|
delimiter |
CREATE TRIGGER update_encrypt BEFORE UPDATE ON cars <<<<<<< what does cars equal? The database name ?
FOR EACH ROW BEGIN
SET NEW.Model = AES_ENCRYPT(NEW.Model,"my passphrase"); <<<<<<< what is NEW.Model ? a new table to be created? an existing table in db? a fieldname in some table?
END;
|
Many Thanks & blessing for explaination. nti