dmccabe Posted February 20, 2009 Share Posted February 20, 2009 i have asked this before I think, but it was a long time ago. i am creating a database for work and I need to create an audit trail of who did what. Is there anyway to set up triggers on a mySQL database so that when a field is update it captures certain information in to another table in the database? Link to comment https://forums.phpfreaks.com/topic/146088-audit-trail-database-triggers/ Share on other sites More sharing options...
Mchl Posted February 20, 2009 Share Posted February 20, 2009 http://dev.mysql.com/doc/refman/5.0/en/triggers.html Link to comment https://forums.phpfreaks.com/topic/146088-audit-trail-database-triggers/#findComment-766929 Share on other sites More sharing options...
redarrow Posted February 20, 2009 Share Posted February 20, 2009 i worked it out na na na lol. example from mchi link very nice! drop tables a,b; create table a(i int); create table b(n int default 0); insert into b values(0); create trigger ainsert before insert on a for each row update b set n=n+new.i; insert into a values(1); select * from b; Link to comment https://forums.phpfreaks.com/topic/146088-audit-trail-database-triggers/#findComment-766930 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.