Re: Log transaction for audit

From: Date: Thu, 05 Aug 2004 17:47:20 +0000
Subject: Re: Log transaction for audit
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-192914@lists.php.net to get a copy of this message
From: "CHAN YICK WAI" <chanyickwai@alumni.cuhk.net> > I'm writing an application that requires log every transactions users done, > e.g. update which record, delete which record, something like that. > > I guess one way is whenever I issue a mysql_query(), I also insert this > query in whole into another table together with the user name, so I can log > and retrieve it out for audit. > > Will you have that kind of experience? How can I do it comprehensively, e.g. > no too big additional coding effort, easy to manage, reliable, etc. Sounds like you just need to write a wrapper for mysql_query() that logs what's going on. function my_mysql_query($query) { log_query($query); return mysql_query($query); } and use my_mysql_query() everywhere instead of mysql_query. ---John Holmes...

« previous php.general (#192914) next »