My code I'm working on has a table db the data is 4.5 I wanted it to be 4.50 any help would be great.
here's my code:
<?php
$con = mysql_connect("localhost", "root", "");
if(!$con) //If we can't connect then stop trying and say so
{
die("Could not connect to server: ". mysql_error());
}
mysql_select_db("inventory_db", $con);
$query = "SELECT * FROM item_inventory";
echo "<table border='1' cellpadding='10' align='center' cellspacing='7'>
<tr>
<th>Item Name</th>
<th>Description</th>
<th>Price</th>
</tr>";
$result = mysql_query($query)
or die("Error " . mysql_error());
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row[ 'ItemName' ] . "</td>";
echo "<td>" . $row['Description'] . "</td>";
echo "<td>$" . $row['Price' ] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
keep in mind that the price table date needs to have this pricison "#.##"