I would like to ask for some opinions or recommendations or guidelines on how to create an automatic logging system for the executed querys on a MySQL database.
- its a php+mysql project
- multiple users can use the database, based upon a user table and a authentication system made in php (they share 1 mysql user)
- so far some query log is implemented, it is not very efficient because ever single logging procedure is hard coded in php
- i am looking for a way to create a general procedure, to which i can pass the user id, and the rest is done automatically
- i need to store previous value, new value, column name, table name, user name, query type, time stamp
I am familiar with TRIGGERS and STORED PROCEDURES, but cant really figure out if that's the the way, and if yes how (don't need code, just pure logic, although a usable minimalistic example would be welcomed).
Edit: Wow, is this question that hard ?