1
I want to show the values in currency format
include "conect.php";
$sql = "SELECT SUM(preco) as SOMA, cod FROM valores GROUP BY cod ORDER BY SOMA DESC";
$exec = mysql_query($sql);
while ($rows = mysql_fetch_assoc($exec)) {
echo $rows["cod"]."-".$rows["SOMA"]."<br><br><br>";
}
Visualization:
BT01-151000
BT02-48000
BT03-22000
BT04-11000
Desired:
BT01- R$ 1.510,00
BT02- R$ 480,00
BT03- R$ 220,00
BT04- R$ 110,00
And the php code?
– Sr. André Baill
<?php include "conect.php"; $sql = "SELECT SUM(price) as SOMA, Cod FROM GROUP BY Cod ORDER BY SOMA DESC"; $exec = mysql_query($sql); while ($Rows = mysql_fetch_assoc($exec)) { echo $Rows["Cod"]." -". $Rows["SOMA"]." <br><br>"; } ?>
– checktech