I want to count totals for all mondays, tuesdays, etc. for any given (user selected) date range, StartDate (sDate) through EndDate (eDate). My current query shows all days within range and I'd like it to SUM my table "count" from each day as it is but display total of each day of week as one occurrence. Using image sample, I want my result to be: Monday - 164 Tuesday - 139 Wednesday - 261 etc.
SQL
SELECT areaname,created, SUM(count) as totals FROM reports WHERE created
between '".$sDate."' AND '".$eDate."' AND area = '".$tArea."' GROUP BY areaname,
created ORDER BY id ASC
html
foreach ($counts as $row) { ?>
<tr><td><?php echo date('l',strtotime($row['reports']['created'])); ?></td>
<?php echo $row[0]['totals']; ?>
}