I want to display 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>";
}
Preview:
BT01-151000
BT02-48000
BT03-22000
BT04-11000
Desired:
BT01- R $ 1.510,00
BT02- $ 480.00
BT03- $ 220.00
BT04- $ 110.00