T
|
thesofa 11/3/2006 |
default values only seem to work on the add page, if you want to add values on edit, you need to do it through events |
J
|
Jane 11/7/2006 |
Graeme, function BeforeEdit(&$values, $where) { $values["Updatedby"] = $_SESSION["UserID"]; $values["UpdatedDate"] = now(); return true; }
|
G
|
gdude66 author 11/7/2006 |
Graeme, to add default values on the EDIT page use Before record updated event on the Events tab. Here is a sample code: where Updatedby and UpdatedDate are your actual field names.
|
J
|
Jane 11/7/2006 |
to get idstaff use following code: global $conn; $str = "select idstaff from TableName where UserName='".$_SESSION["UserID"]."'"; $rs = db_query($str,$conn); $data = db_fetch_array($rs); $values["Updatedby"] = $data["idstaff"];
|
G
|
gdude66 author 11/7/2006 |
to get idstaff use following code: where UserName is your actual field name, Tablename is your actual table name.
|