thanks for the quick reply
i'm using something similar to that.. the problem i have is that $messagen would be the table below would this work?
G
$messagen="
<table width=100% border=0 cellspacing=10 cellpadding=0>
<tr>
<td valign=top>ITEM</td>
<td align=right>QTY</td>
</tr>
<tr>
<td height=1 colspan=2 valign=top bgcolor=#666666></td>
</tr>
<?php
MYSQL_CONNECT("$host","$user","$pass");
mysql_select_db("$db");
$query = "SELECT *, titles.id AS tid, orders06.id AS oid FROM version INNER JOIN artists ON version.artist_id = artists.id INNER JOIN formats ON version.format_id = formats.id INNER JOIN titles ON version.title_id = titles.id INNER JOIN orders06 ON version.id = orders06.version_id WHERE orders06.basket_id = '$_SESSION[basket]'";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
// if records present
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_object($result)) {
echo "
<tr>
<td valign=top><div class=artist>$row->artist</div>
<div class=title> $row->title</div>
$row->format - £$row->price (each)
</td>
<td align=right valign=top align=right> $row->qty
</td>
</tr>
";
//// work out the total price for each item (qty*price)
$orderprice = $row->qty*$row->price;
$totalprice += $orderprice;
}}
?>
<tr>
<td height=1 colspan=2 valign=top bgcolor=#666666></td>
</tr>
<tr>
<td >PRICE</td>
<td align=right>£<?php echo number_format ($totalprice, 2); ?></td>
</tr>
<tr>
<td height=1 colspan=2 valign=top bgcolor=#666666></td>
</tr>
</table>";