This topic is locked

Auditing

6/24/2010 9:35:51 AM
PHPRunner General questions
S
swanside author

I am performing the auditing on a few of my tables, but, I really want to be able to record when a record is selected for export?

How can I record this?
Procedure is, from the list page, we will select a record or a few records, and export selected results. I want to be able to save the date and time and id of the records being exported?

Cheers

Paul.

A
ann 6/25/2010

Paul,
use Export page: Before SQL query on the Events tab to save user's name, time and record id for export into the audit table. Here is a sample:

$sql1="select * from AuditTableName where $strWhereClause";

$rs=CustomQuery($sql1);

$data=db_fetch_array($rs);

while ($data)

{$idfield.=$data["Id"];}

$sql2="update AuditTableName set UserName='".$_SESSION['UserID']."', ExpTime=now(), RecordId='".$idfield."'";

CustomQuery($sql2);



where UserName, ExpTime, RecordId are your actual field names, AuditTableName is your actual audit table name.

S
swanside author 6/25/2010



Paul,
use Export page: Before SQL query on the Events tab to save user's name, time and record id for export into the audit table. Here is a sample:

$sql1="select * from AuditTableName where $strWhereClause";

$rs=CustomQuery($sql1);

$data=db_fetch_array($rs);

while ($data)

{$idfield.=$data["Id"];}

$sql2="update AuditTableName set UserName='".$_SESSION['UserID']."', ExpTime=now(), RecordId='".$idfield."'";

CustomQuery($sql2);



where UserName, ExpTime, RecordId are your actual field names, AuditTableName is your actual audit table name.


Thanks Ann