This topic is locked

Modified by field

4/15/2007 1:13:10 PM
PHPRunner General questions
P
phpwalker author

I have a field called modifiedby in a table. I would like to make this field read-only and to have it automatically updated with the username of the person who makes changes to the record.
I found some forum topics that accomplished this through inserting values into a SEPARATE log table, but I wanted to just add this to the table (and record) where the change are being made.
I hope that made sense.

J
Jane 4/16/2007

Hi,
you can do it using Before record updated event on the Events tab.

Here is a sample:

$values["modifiedby"]= $_SESSION["UserID"];



where modifiedby is your actual field name.

kujox 4/16/2007

In the before record updated event just add
$values['modifiedby'] = $_SESSION['UserID'];