This topic is locked
[SOLVED]

 PHPScript Code Inquiry

7/4/2016 1:54:37 AM
PHPRunner General questions
J
jefflau author

Hi All,

I would like getting help on a code, useracct I do had many query like below but it won't be updated to the database
Second when I used the annual_entitle minus up the annual_used I getting empty. May someone help me

ROUND((DATEDIFF(NOW(), emp_date)-186)/365) * TIMESTAMPDIFF(YEAR,emp_date,Now()) AS annual_entitle,

medical_entitle,

ROUND(DATEDIFF(NOW(), emp_date)/7) AS off_entitle,

annual_used,

medical_used,

off_used,

(SUM(annual_entitle)-SUM(annual_used)) AS annual_balance,

(SUM(medical_entitle)-SUM(medical_used)) AS medical_balance,

(SUM(off_entitle)-SUM(off_used)) AS off_balance,
Sergey Kornilov admin 7/4/2016

You cannot update your database this way. In SQL query you can select values, perform calculations on the fly etc however it will be only applied to the values that are displayed on the page.
To update data in the database you need to use the method described in http://xlinesoft.com/articles/how_to_use_calculated_fields.htm article, bullet #2

J
jefflau author 7/4/2016



You cannot update your database this way. In SQL query you can select values, perform calculations on the fly etc however it will be only applied to the values that are displayed on the page.
To update data in the database you need to use the method described in http://xlinesoft.com/articles/how_to_use_calculated_fields.htm article, bullet #2


Than a lot for your info Sir