Log when a row is deleted from a given table in MySQL -


i have mysql-table that's accessed different apis. log when rows deleted table. possible?

yes, can use simple trigger, like;

create trigger data_delete before delete on data each row begin   insert log(logmessage) values (concat('delete of value ', old.id)); end 

a simple sqlfiddle demo.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -