hi i have written code but there is mistake in calculation....
i want to show price according to quantity in table.....but quantity is right but price is not rice..
code is

<?php
$brush_price = 5;
$counter = 10;

echo " <table border=\"1\" align=\"center\">";
echo "<tr><td>Quantity</td><td>Price</td></tr>";

while($counter<=100)
{
	echo "<tr><td>$counter</td><td>$brush_price</td></tr>";
	$brush_price = $brush_price * $counter;
	$counter = $counter +10;
	
}

echo "<table>";

hope someone will help me..
Regards..

?>
<?php
$brush_price = 5;
$quantity = 10;
$total = $brush_price * $quantity;
echo "<table border=\"1\" align=\"center\">
<tr><td>Quantity</td><td>Price</td></tr>
<tr><td>$quantity</td><td>$total</td></tr>";
?>

Bye.

commented: 1 +3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.