I am trying to get the total sum of some values from my db, my code below just outputs “Array” and not the actual numbers… any ideas?
$query_c1 = "SELECT SUM(order_price) AS total_price FROM orders WHERE charity_coupons_code = 'test1'";
$dbc1 = mysqli_connect('localhost', 'yellowb_user','data123','yellowb_data');
$data=array();
$db_charity = mysqli_query($dbc1,$query_c1);
while($row= mysqli_fetch_array($db_charity)) {
$data[] = $row[0];
}
echo $data;