I have the following query in the before record added and also before record updated.
$values["age_field"] = (strtotime("now")-strtotime($values["FieldName"]))/(606024*365);
return true;
When I add a new record and click on save this works and calculates perfectly fine, however when I use this in before record updated I get an error "Parse error: syntax error, unexpected 'return' (T_RETURN) in", if I remove the return true; out of the query I'm unable to save the record at all.
Be greatful for any assistance.
Many thanks
Jason