0

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..

?>
2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by cereal
1
<?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.

Votes + Comments
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.