Tuesday, 3 September 2013

How to MINUS sum of values from sum of values php and mysql

How to MINUS sum of values from sum of values php and mysql

am very new in php, and I have serious question to get the answer, I hope
you will help me.
I have a table on mysql named "Payment" with the following fields
(School_fee | Fee_setting | Trans_port | trans_setting)
in fields setting of all fields i set the actual total amount of money
which student suppose to pay for appropriate service per 3 month, and
student can pay for installment, So guys I want when I set may be 100000
at once in fee_setting, and when student come and pay 20000 as School_fee
the amount will be reducted each time when student pay a school_fee. this
means (fee_setting) it will reduct total number of school_fee payed by a
certain student.
I have the codes but this reduct only first student and others student the
results comes with negative sign(-), Am confused i don't know where the
problems is.Here the codes
echo $results['SUM(fee_setting)'] - $results ['SUM(school_fee)']."";

No comments:

Post a Comment