First thanks for the help, I am trying to caculate and display a grand total.
The code is as follows any chance some one could fill in the missing code...
<title>Job Number Results</title>
</head>
<body>
<p align="center">
<h2 align="center">Search Results for Job Number <?php echo $jobnum; ?><br></h2>
<p align="center">
<hr>
<p>
<p><table border="0" cellpadding="0" cellspacing="1" align='CENTER' width="80%">
<?php
$query = "SELECT vendor.name,
SUM( line_items.amount ) AS Total,
po.po_number
FROM po
INNER JOIN vendor ON (po.vendor = vendor.id)
INNER JOIN line_items ON (po.po_number = line_items.po_number)
WHERE
(
(jobnum = $jobnum)
)
GROUP BY vendor.name, po.po_number";
$result = mysql_query($query,$db);
if( !$result )
{
die("Error executing query");
}
echo "<tr>";
echo "</tr>";
$nrows = mysql_num_rows($result);
$row = 0;
while( $row < $nrows )
{
$name = mysql_result($result,$row,"name");
$po = mysql_result($result,$row,"po_number");
$amount = mysql_result($result,$row,"Total");
$grand = $amount +$row['Total'];
echo "<tr>";
echo " <td align='LEFT' ><font face='Arial' size='2' color='#000000'>".$name."</font></td>";
echo " <td align='CENTER' ><font face='Arial' size='2' color='#000000'>".$po."</font></td>";
echo " <td align='RIGHT' ><font face='Arial' size='2' color='#000000'>".$amount."</font></td>";
echo "</tr>";
$row++;
}
mysql_free_result($result);
mysql_close();
?>
</table>
<hr>
<table cellpadding="0" cellspacing="0">
<tr>
<td width="869">
<p align="right"><b><font size="4">Grand Total <?php echo $grand ?></font></b>
</p>
</td>
</tr>
</table>