0"); ?>

Super Mario's Fruits, Thank you

You have ordered: $qty) if ($fruit != 'who' && $qty > 0) { pg_query_params("insert into sold values ($1,$2)", array($fruit,$qty)) or die ("yes, we have no $fruit, sorry."); // oops, need to look up price $priceresult = pg_query_params("select price::numeric from fruit where name=$1", array($fruit)); $price = pg_fetch_result ($priceresult,0,0); $total = $price*$qty; $sum += $total; // price is now MONEY print "\n"; } pg_query("commit"); $sum = number_format($sum,2); print "\n"; ?>
FruitQuantityPriceTotal
$fruit$qty$price$total
Total for all$ $sum