Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql BEFORE UPDATE INSERT

drop trigger if exists history;
delimiter //
CREATE TRIGGER history
BEFORE UPDATE ON table_name
FOR EACH ROW 
	BEGIN
    INSERT INTO his_table(numer, data, ilosc)
        VALUES(old.numer, old.numer, old.ilosc);
    END;
    //
 
PREVIOUS NEXT
Tagged: #mysql #BEFORE #UPDATE #INSERT
ADD COMMENT
Topic
Name
5+8 =