Forum Moderators: coopster
Date: mar 5 06
Vendor: ph
Tax: 3.00
Cost: 250.00
how can i add all values of cost and tax together, like so:
Tax Cost: 5.00
Total Cost: 350.00
Grand Total: $450.00
any tutorial sites i was able to find didn't have anything to do with php
but no result (the table shows as empty) or just simply doesn't show anything.
for coopster's suggestion, once i got it to select properly i tried echo $total; but it didn't show anything either
$totalTax = 0; // initialize
$totalCost = 0; // initialize
while (looping through the result set) {
$totalTax += $row['tax'];
$totalCost += $row['cost'];
}
$grandTotal = $totalTax + $totalCost;
[dev.mysql.com...]