This topic is locked

Calculating date issue in Edit screen

8/3/2014 2:49:17 PM
PHPRunner General questions
J
jasongreenwood author

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

Sergey Kornilov admin 8/6/2014

Jason,
there must be something else in this event that causes this syntax error. If you need more help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.