Sean Moore
Sean Moore

Reputation: 1

Can not display MySQL data decimal(16,2) in PHP

I have an MySQL data base that has a cell in a record called balance. The db shows it is stored as a decimal(16,2). When I try to display the vale of the record with echo $row["balance"]; In PHP, it display nothing at all. Can you please point me in the right direction. Thanks you.

$sql = "SELECT id, email, username FROM ppb_users WHERE id = '$USERIDX' "; $result = $conn->query($sql);

if ($result->num_rows > 0) 
   {
    //// output data of each row
    while($row = $result->fetch_assoc())
       {
         echo "<br> id: " . $row["id"] . "<br> email: " . $row["email"] . "<br> username: " . $row["username"] . "<br> Ballance: " . $row["balance"] ."<br>";           
         
         $UserEmail = $row["email"];
         $balancex = $row["balance"]; 
       }
   } 
else 
   {
     echo " 0 results <br><br>";
   }

$conn->close();

Upvotes: 0

Views: 67

Answers (1)

Sean Moore
Sean Moore

Reputation: 1

Sorry folks, it would seem I had one of those moments in where when it is over and you realize what you did, how small you feel. I did not add balance to the SQL se3lect line. Uggg! Soryy.

Upvotes: 0

Related Questions