Hello,
It's been a while since my last post, greetings to all, anyway, I've forgotten how to do something fairly simple. I am pulling rows from a mysql table, one of the fields is a dollar value (xx.xx). After all the rows are pulled, how do I sum the dollar value field...
<?
@include("dbconnect.php");
$query = "select * from orders where orderStatus = 'closed'";
$result = @mysql_query($query, $mysql_link);
while($row = @mysql_fetch_row($result))
{
echo "<table width=\"450\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">";
echo "<tr><td width=\"150\" align=\"left\" bgcolor=\"$lnav_bg_color\"><font face=\"arial, helvetica, verdana\" size=\"2\" color=\"000000\"> $row[2]</font></td>";
echo "<td width=\"150\" align=\"right\" bgcolor=\"$lnav_bg_color\"><font face=\"arial, helvetica, verdana\" size=\"2\" color=\"000000\"> $row[6]</font></td>";
echo "<td width=\"150\" align=\"left\" bgcolor=\"$lnav_bg_color\"><font face=\"arial, helvetica, verdana\" size=\"2\" color=\"000000\"> $row[13]</font></td>";
echo "</tr></table>";
}
?>
Please note, $row[6] is the field I need to sum .
I know it's basic, just having a brain spasm this morning, thanks,
Cyronuts