i try to display a 'double' value from the MySQL column, i am converting it using number_format()
but the whole time i get is 0.00 as answer.
My code;
PHP:
<?php
$user = $_SESSION['username'];
$a = $_GET['a'];
// ...
if ($a == "balance") {
$querys= "SELECT balance FROM users WHERE Username='$user'";
$results= mysql_query($querys);
$rows = mysql_fetch_row($results);
$bfloat = number_format($rows['balance'], 2);
echo $bfloat;
}
?>
The convertion is working, the only problem is that the answer is 0.00 and not the balance that the user has. Example; 1.37