Hi, I have a piece of code below that outputs various DVD's a person has in there cart and a display of the price({$row1["dvd_price"]}). what i want is a total of these costs output on the page but i am not exactly sure how to go about this.....if anyone could help me that would be great, thanks in advance,
-AD
<html>
<body>
<p align='center'><font face="Courier"><b><font size="5"></font> </b></font></p>
<?php
$email='joe@bloggs.com';
$db="test";
$link = mysql_connect("localhost");
if (! $link)
die("Couldn't connect to MySQL");
mysql_select_db($db , $link)
or die("Couldn't open $db: ".mysql_error());
$query = "SELECT * From cartdvds WHERE email='$email'";
$result = mysql_query($query);
echo "<div align=center><table bordercolor=#000000 border=0 width=100% cellspacing=0>\n";
echo "<tr>
<td width=12% height=41><span style=font-weight: 400>
<font size=4 face=Courier></font></span></td>
<td width=10%><span style=font-weight: 400>
<font size=4 face=Courier></font></span></td>
<td width=30%><span style=font-weight: 400>
<font size=4 face=Courier></font></span></td>
<td width=15%><span style=font-weight: 400>
<font size=4 face=Courier></font></span></td>
</tr>\n";
while ($row = mysql_fetch_array ($result)) {
$dvd_id=$row['dvd_id'];
$query1 = "SELECT * From dvds WHERE dvd_id='$dvd_id'";
$result1 = mysql_query($query1);
while ($row1 = mysql_fetch_array ($result1)) {
$dvd_name=$row1['dvd_name'];
echo" <tr>
<td ><font size=4 face=Courier> </font></td>
<td ><font size=4 face=Courier><img src='{$row1["thumb"]}'></font><p></p></td>
<td ><font size=4 face=Courier><b>{$row1["dvd_name"]}</b>
</br>{$row1["dvd_price"]}
</br><b>{$row1["synopsis"]}</b></font></td>
<td >Remove</td>
</tr>\n\n";
}
}
echo '</table>'
?>
</body>
</html>