PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
MDB2 - Automating a change log using custom error handler?

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database
View previous topic :: View next topic  
Author Message
cmayo



Joined: 17 Jun 2008
Posts: 2

PostPosted: Tue Jun 17, 2008 10:01 pm    Post subject: MDB2 - Automating a change log using custom error handler? Reply with quote

Hi All,

I'm looking for a way to create a database change log for a contract client's office management system without having to re-code 700+ queries, and it occurred to me that since the project uses MDB2, there might be a way to hook into every query run against the MySQL database and write some PHP code to perform some automagic functionality... perhaps query the database for current field values before executing INSERT or UPDATE statements, then again after inserting or updating, and writing any changed fields to a changelog table.

Or maybe I can use MDB2's debug handler to capture all the queries executed by each page, parse the queries to grab the tables and fields being updated or inserted and the field values and use that data to maintain a sort of "current state" table for the database tables and record the fields which have changed since the last update, but writing even a modestly robust query parser in PHP is likely beyond my MySQL skillset. I could manage to parse simple statements affecting single tables, but some of the queries involved use JOINs and such and I'm thinking that trying to parse multi-table queries would kick my tail, programatically speaking.

Anyway... not sure if this is the right site or forum to discuss this issue, but I'm having a bit of trouble finding an active MDB2 forum...

Any ideas, suggestions, or pointers to a more appropriate forum would be greatly appreciated.
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Tue Jun 17, 2008 10:57 pm    Post subject: Reply with quote

The MDB2 developers / maintainers are active on the pear-general mailing list. Chances are high that you'll get a helpful answer there.
=> http://pear.php.net/support/lists.php
Back to top
View user's profile Send private message
cmayo



Joined: 17 Jun 2008
Posts: 2

PostPosted: Wed Jun 18, 2008 5:46 am    Post subject: Reply with quote

Mark, thanks for the tip. I've subscribed to the general list and will post my question to the list tomorrow.

Chuck
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Database All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software