[prev in list] [next in list] [prev in thread] [next in thread]
List: pear-general
Subject: [PEAR] MDB2: Automating a database change log
From: Charles Mayo <charlesmayo53 () yahoo ! com>
Date: 2008-06-18 20:25:45
Message-ID: 155553.84123.qm () web46207 ! mail ! sp1 ! yahoo ! com
[Download RAW message or body]
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. The change log would record \
changes made to each record in selected tables, new records created in those tables, \
the user performing the change (available to me in PHP session variables) and the \
date and time of the change.
It occurred to me that since every query in the system runs through MDB2 there might \
be some way to use some of MDB2's functionality to accomplish my goal, and I've been \
looking at MDB2's debug functions, wondering if I could use debug data to keep track \
of record changes.
All I've been able to learn about MDB2's debug function so far is that I can get a \
list of all queries run by a script. I'm thinking of trying to write some sort of \
query parser in PHP to ferret out each table and record that's been inserted or \
updated by a script, run a query to return the modified records and use those results \
to maintain a change log by comparing each field to previously-recorded values, but \
writing even a modestly robust query parser in PHP is likely beyond my MySQL \
skillset, so I'm wondering if perhaps someone more knowledgeable about MDB2 could \
suggest a better/easier way.
Any ideas, suggestions, or pointers would be greatly appreciated.
Thanks,
Chuck
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic