I want to add all sales made in one day. I have a column called 'amount' in my transactions table, and a dateCreated column too.
I know how to choose what dates I wish to query by, but totalling the amounts together for a specific date is eluding me.
Here is what I attempted:
<?
$sum5 = mysql_query("SELECT SUM(amount) FROM transactions WHERE dateCreated = '$today'");
$total5 = mysql_query($sum5);
echo $total5;
?>
I think the query is correct. I checked it in phpmyadmin. I just think the method to echo the result is what I'm doing wrong.