PHP code for selecting data from SQL Table using where Clause

So, I cant seem to get the result from this. It’s returning a blank message. Any help

[php]<?php

include(‘dbconnect.php’);

  $query="SELECT commission FROM sales WHERE status='Approved' ORDER BY id ASC";
  $result=mysql_query($query);
    while ($row = mysql_fetch_array($result))

{

$amount++;
   
$totalAmount= $row["SUM(commission)"];

print “”.$totalAmount."";
}

?>[/php]

You are using obsolete code that has been completely removed from Php. You need to use PDO.

https://phpdelusions.net/pdo

And this is wrong:
$row[“SUM(commission)”]

Get rid of the obsolete html and use CSS to format your pages.

Sponsor our Newsletter | Privacy Policy | Terms of Service