"firalivet" <webforumsuser@macromedia.com> wrote in
message
news:go1j76$d4l$1@forums.macromedia.com...
> One column
> has a list of prices, and I need to sum the list of
prices. I know
> this is
> pretty simple stuff.
There are several ways to do this, but a simple way is to
create a
variable to hold a running total and add the current price to
it when
you display each row. The following is a simplified example
of the
code:
<?php $total = 0; ?>
<?>php do { // this is the start of the repeat region
?>
<tr><td><?php echo
$row_recordsetName['price']; $total +=
$row_recordsetName['price']; ?></td></tr>
<?php } while ($row_recordsetName =
mysql_fetch_array($recordsetName)); // end of repeat region
?>
<tr><td><?php echo $total;
?></td></tr>
--
David Powers
Adobe Community Expert, Dreamweaver
http://foundationphp.com