 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
cmayo
Joined: 17 Jun 2008 Posts: 2
|
Posted: Tue Jun 17, 2008 10:01 pm Post subject: MDB2 - Automating a change log using custom error handler? |
|
|
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 |
|
 |
mark

Joined: 07 Jan 2007 Posts: 1003
|
Posted: Tue Jun 17, 2008 10:57 pm Post subject: |
|
|
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 |
|
 |
cmayo
Joined: 17 Jun 2008 Posts: 2
|
Posted: Wed Jun 18, 2008 5:46 am Post subject: |
|
|
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 |
|
 |
|
|
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
|
|