Welcome Guest, Not a member yet? Register   Sign In
How to log all modifications from the Model
#1

[eluser]EricDele[/eluser]
Hi

I have a site where I want to log in a database table all modifications that users are doing from the site on the database.

For this I want to use a table like that :
Code:
CREATE TABLE TLOG
(
   snap        DATE,
   userid      VARCHAR2(16),
   action      VARCHAR2(16),
   classe      VARCHAR2(32),
   methode     VARCHAR2(32),
   info        VARCHAR2(256)
)

example : log in the TLOG table that user X change the number of banana in the cart.

I was searching for implemneting it in the model class constructor, so if I could retrieve all the datas I need I will be able to insert in my log the information, by the only things I retrieve are the controller and method name with the $this->router->fetch_class() and $this->router->fetch_method(), not the model methode name.

Anyone have an idea ?




Theme © iAndrew 2016 - Forum software by © MyBB