I have this code that shows the total sale until the current date, but shows it this way
Array (
[Date] => 2014-01-25
[TotalSales] => 7
)
Is there any way where I can show in this way Total Sale: 7 And Date: 2014-01-25?
<?php
$host = 'localhost';
$user = 'root';
$passwd = '';
$database = 'p_database';
$connect = mysql_connect($host,$user,$passwd) or die("could not connect to database");
$query = "SELECT DATE(order_time) AS Date, SUM(Quantity) AS TotalSales
FROM ss_orders,ss_ordered_carts
WHERE DATE(order_time) = DATE(NOW())
group by date;";
mysql_select_db($database,$connect);
$result = mysql_fetch_assoc(mysql_query($query));
print_r($result);
?>
source
share