Welcome Guest, Not a member yet? Register   Sign In
Automatic database logging

You would need to insert this code into a model, so that every time you perform a database action it would call that code within the model. If your models are fairly small you could just create a function which gets called every time and just pass int the string you want to write.

If you want to use it across many models, then it might be better to create a reusable class.

I just remembered: I actually created an application that loggs relavent user actions (inserts/updates/deletes etc...) to the database. To do this, I just created another table in the database (called it log). And then just inserted the timestamp and string.

I used transactions with the queries, as i had to perform 2 queries each time something happened.

Messages In This Thread
Automatic database logging - by El Forum - 07-24-2009, 06:51 AM
Automatic database logging - by El Forum - 07-24-2009, 11:47 AM

Theme © iAndrew 2016 - Forum software by © MyBB