How to MINUS sum of values from sum of values php and mysql -
am new in php, , have serious question answer, hope me.
i have table on mysql named "payment" following fields
(school_fee | fee_setting | trans_port | trans_setting)
in fields setting of fields set actual total amount of money student suppose pay appropriate service per 3 month, , student can pay installment, guys want when set may 100000 @ once in fee_setting, , when student come , pay 20000 school_fee amount reducted each time when student pay school_fee . means (fee_setting)
reduct total number of school_fee payed student.
i have codes reduct first student , others student results comes negative sign(-), confused don't know problems is.
here codes:
echo $results['sum(fee_setting)'] - $results ['sum(school_fee)']."</td>";
i think need abs()
avoid negative values :
echo abs($results['sum(fee_setting)'] - $results ['sum(school_fee)'])."</td>";
Comments
Post a Comment