MySQL Group Results by day using timestamp
Are you just forgetting to add GROUP BY … at the end? SELECT COUNT(id) as order_count, SUM(price + shipping_price) as order_sum, DAY(FROM_UNIXTIME(created)) as order_day FROM `order` WHERE ‘.implode(‘ AND ‘, $where).’ GROUP BY order_day NOTE: You cannot use as day for your day column because day is a MySQL function. Use something like order_day. Of … Read more