thanks clint
Code: Select all
include("Connect.php");
$query="SELECT p.PartNumber, p.Description, (p.IncTax*1.3) AS Price FROM `price list` p WHERE p.CategoryID = '100' order by PartNumber";
$data_resource=mysql_query($query,$connection);
//Defining HTML table
$rowcount = 0;
$table="<table cellspacing=0 cellpadding=0 width=400>";
while ($row = mysql_fetch_array($data_resource)) {
$rowcount++;
$table.=sprintf('<tr bgcolor="%s"><td>'.$row['Description'].'</td>', $rowcolor);
$table.=sprintf('<td>'.$row['Price'].'</td></tr>', $rowcolor);
$rowcolor = $rowcount % 2 == 0 ? "#FFFFFF" : "#C4DAFA";
}
//Closing HTML table
$table.="</table>";
//Displying table and closing mysql database if not need
echo $table;
mysql_close();