Q:

Can't Display SQL Query Result

<?php
include "config.php";

$query = "SELECT SUM(total) FROM sales WHERE date = CONCAT(DATE_SUB(curdate(), INTERVAL 2 DAY),' ','00:00:00')";

$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo $row['total'];

echo mysql_error();
?>

I have also tried echoing the $row variable without the array and it would display "Array" on the screen. Basically the result of the query should output a number and it's not doing so currently.

A:

Because its the sum of total, its no longer referred to as $row['total'].
Try $row[0]
:)

