This topic is locked

Saving $values before delete event

10/8/2007 6:53:59 PM
PHPRunner General questions
A
acpan author

Hi,
I am trying to implement a generic procedure for audit trial table.
So wherever the pages are, when user press delete, all the values of the forms will

be stored in the audit trial table without naming the field individually.
May be loop through all the fields in $deleted_values[], then concatenate them

into 1 string, and insert it to the audit trial table. Would appreciate any advises.
Thanks

Dex

J
Jane 10/9/2007

Dex,
Before record deleted event is run for every deleted record.

To insert deleted record to another table add following code to the Before record deleted event:

$global $conn;

$strInsert = "insert into NewTable (FieldName1,FieldName2) values (".$deleted_values["FieldName1"].",'".$deleted_values["FieldName2"]."')";

db_exec($strInsert,$conn);



where FieldName1 and FieldName2 are your actual field names, FieldName1 is the numeric field, FieldName2 is the text or date field.