This topic is locked

After Record is updated

5/4/2009 2:50:45 PM
PHPRunner General questions
lewisgr author

I need to record who and when a record was updated. I found the event after update but I'm not sure how to refer to field name on the page. Could someone tell me the code to refer to the modifyby & modifydatatime fields?
For example in Access I would write this:
me.modifyBy = me.username

me.modifydatetime = now()
I know this isn't Access but that's all the coding I know. Sorry.

A
amuro 5/4/2009

global $conn;
$modifyby = $_SESSION["UserID"];

$modifydatatime = date("Y-m-d H:i:s");
$strSQLUpdate = "UPDATE yourtable SET modifyby='$modifyby', modifydatatime='$modifydatatime' WHERE yourwhere";

db_exec($strSQLUpdate, $conn);
return true;