$username Posted February 1, 2008 Share Posted February 1, 2008 Hello All, So I have 2 Columns in my table Total and Paid I want to subbtract them so that it will tell me the total. These will have more then one value in the rows Total Paid 100 50 200 25 300 10 ------------- 600 - 85 = 515 Is there a mysql way or a PHP way of doing this? Thanks Brett Quote Link to comment https://forums.phpfreaks.com/topic/88830-solved-mysql-subtract-add-to-table-columns-for-one-value/ Share on other sites More sharing options...
$username Posted February 1, 2008 Author Share Posted February 1, 2008 So I got it by doing something like this while($row532 = mysql_fetch_array($sql532)) { $TotalAmountOwed += $row532['BillingAmount'] - $row532['BillingAmountPaid']; } Thanks Brett Quote Link to comment https://forums.phpfreaks.com/topic/88830-solved-mysql-subtract-add-to-table-columns-for-one-value/#findComment-454976 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.