Sum of a dynamic sum?
Posted: Fri Jan 09, 2009 12:10 am
question: I would like to add up all the totals that are produced here. It loops through rows and gives me a total for each row. In red is my calculation for each row total.
it looks like this:

So how do I add up the totals?
Code: Select all
<?php do { ?>
<tr class="table_items">
<td class="table_items"><?php echo $row_DetailRS1['CTASKNAME']; ?></td>
<td class="table_items"><div align="right"><?php echo number_format($row_DetailRS1['YESTHRRATE'],2); ?></div></td>
<td class="table_items"><div align="right"><?php echo number_format($row_DetailRS1['NESTHRS'],2); ?></div></td>
<td class="table_items"><div align="right"><?php echo number_format($row_DetailRS1['YESTFLRATE'],2); ?></div></td>
<td class="table_items"><div align="right"><?php echo number_format($row_DetailRS1['NESTMUP'],2); ?></div></td>
<td class="table_items"><div align="right"><?php echo number_format($row_DetailRS1['NADJHRS'],2); ?></div></td>
<td class="table_items"><div align="right">[color=#BF0000]<?php echo number_format(($row_DetailRS1['YESTHRRATE'] * $row_DetailRS1['NESTHRS']) + ($row_DetailRS1['YESTFLRATE'] + ($row_DetailRS1['YESTFLRATE'] * $row_DetailRS1['NESTMUP'])),2); ?>[/color]</div></td>
<td class="table_items"> </td>
<td class="table_items"> </td>
<td class="table_items"> </td>
<td class="table_items"> </td>
<td class="table_items"> </td>
</tr>
<?php } while ($row_DetailRS1 = mysql_fetch_assoc($DetailRS1)); ?>
</table>
So how do I add up the totals?