0

I have been trying to sum all the value of a column in php..but it isn't working..

$query="SELECT SUM(total_earnings) as `total` from daily_report";
$res=mysqli_query($connect,$query);
$data=mysqli_fetch_assoc($res);

echo $data['total'];
Barmar
  • 669,327
  • 51
  • 454
  • 560

0 Answers0