phpmyadmin php trigger code example
Example 1: Create Trigger in phpMyAdmin
delimiter //
CREATE TRIGGER before_insert_money BEFORE INSERT ON money
FOR EACH
ROW
BEGIN
UPDATE accounts SET balance=10.0;
END;
//
delimiter ;
Example 2: Create Trigger in phpMyAdmin
CREATE TABLE contacts
( contact_id INT(11) NOT NULL AUTO_INCREMENT,
last_name VARCHAR(30) NOT NULL,
first_name VARCHAR(25),
birthday DATE,
CONSTRAINT contacts_pk PRIMARY KEY (contact_id)
);