This topic is locked
[SOLVED]

  Audit Table Question

4/5/2013 7:23:00 AM
PHPRunner General questions
C
chrispa author

audit table is a very important future and well done.
a question in case i use custom php scripts for example on visual editor of a list page i may add a dropable field and by selecting a value will

update child tables ( just an example ) will that be audited to audit log tables ?
thanks

chris

Sergey Kornilov admin 4/5/2013

If you use a custom PHP script you can simply insert a relevant record into audit table programmatically.

C
chrispa author 4/6/2013



If you use a custom PHP script you can simply insert a relevant record into audit table programmatically.


hi thanks
can you pls tell me if you call a specific script in phprunner for audit log in table changes so i can call same ? and not writing a script from the beginning

thanks

Sergey Kornilov admin 4/6/2013

No, there is a specific script that you can call. However audit table structure is simple, none of fields are required and you can simply insert a free form log record there.
Here is the structure of this table:

id INT(11) NOT NULL AUTO_INCREMENT,

datetime DATETIME NOT NULL,

ip VARCHAR(40) NOT NULL,

user VARCHAR(250),

table VARCHAR(250),

action VARCHAR(250) NOT NULL,

description LONGTEXT
The fields that you need to fill are:

datetime - datetime of the action, use now(),

ip - ip address of the user, use $_SERVER['REMOTE_ADDR']

action - can be anything you want like "order added" or "email sent" or "custom script called"

description - any additional info
If you are not sure how to insert a record into audit table use DAL:

http://xlinesoft.com/phprunner/docs/add.htm
Note: in order to use DAL you need to add audit table to the project.

C
chrispa author 4/9/2013



No, there is a specific script that you can call. However audit table structure is simple, none of fields are required and you can simply insert a free form log record there.
Here is the structure of this table:

id INT(11) NOT NULL AUTO_INCREMENT,

datetime DATETIME NOT NULL,

ip VARCHAR(40) NOT NULL,

user VARCHAR(250),

table VARCHAR(250),

action VARCHAR(250) NOT NULL,

description LONGTEXT
The fields that you need to fill are:

datetime - datetime of the action, use now(),

ip - ip address of the user, use $_SERVER['REMOTE_ADDR']

action - can be anything you want like "order added" or "email sent" or "custom script called"

description - any additional info
If you are not sure how to insert a record into audit table use DAL:

http://xlinesoft.com/phprunner/docs/add.htm
Note: in order to use DAL you need to add audit table to the project.


thank you Sergey
Audit Table is very interesting and i have another question

i use that function already on my phprunner project and i see that the audit tables when i change or add or delete a

record then in audit table i see that format


Can you help and advise if you call some specific script so i can use same to get same format for scripts that will update mysql ?
thanks in advance

Sergey Kornilov admin 4/9/2013

No, there isn't a script you can use. You have to write your own code for this purpose.
If you are not sure how to insert a record into audit table use DAL:

http://xlinesoft.com/phprunner/docs/add.htm
Note: in order to use DAL you need to add audit table to the project.