<?
$koneksi = mysql_connect("localhost",'root','');
if(!koneksi){
die ('tidak ada koneksi'.mysql_error());
}
?><table width="294" border="1">
<tr>
<td width="20" bgcolor="#CCCCCC"><pre>id</pre></td>
<td width="56" bgcolor="#CCCCCC"><pre>Pembeli</pre></td>
<td width="60" bgcolor="#CCCCCC">Nilai 1</td>
<td width="62" bgcolor="#CCCCCC">Nilai 2</td>
<td width="62" bgcolor="#CCCCCC"><pre>Total</pre></td>
</tr>
<?
mysql_select_db('dbpenjualan', $koneksi);
$query = "select * from tpembeli";
$hasil = mysql_query($query);
while($row = mysql_fetch_array($hasil)){
?>
<tr>
<td><? echo $row['id_pembeli']; ?> </td>
<td><? echo $row['nama_pembeli']; ?> </td>
<td><? echo $nilai_1 = $row['nilai1']; ?></td>
<td><? echo $nilai_2 = $row['nilai2']; ?></td>
<td><? echo $total = $nilai_1 + $nilai_2; ?></td>
</tr>
<? } ?>
</table>
<p>View Total max = ? </p>
thank's