I'm using datetime to store dates of when new data is entered per provider. Using the following query to pull the results:
SELECT COUNT(id) AS addedCount,
date(date_added) AS dateAdded,
provider_name as provider
FROM `table` WHERE `table`.`id` IN (SELECT `table`.`id` FROM `table`
WHERE `table`.`active` = '1')
GROUP BY dateAdded
ORDER BY dateAdded DESC
The array looks like this:
array(1343) {
[0]=>
array(3) {
["addedCount"]=>
string(1) "2"
["dateAdded"]=>
string(10) "2012-03-03"
["provider"]=>
string(5) "Provider_1"
}
[1]=>
array(3) {
["addedCount"]=>
string(1) "1"
["dateAdded"]=>
string(10) "2012-03-03"
["provider"]=>
string(5) "Provider_1"
}
[2]=>
array(3) {
["addedCount"]=>
string(1) "1"
["dateAdded"]=>
string(10) "2012-03-03"
["provider"]=>
string(5) "Provider_2"
}
[3]=>
array(3) {
["addedCount"]=>
string(1) "1"
["dateAdded"]=>
string(10) "2012-03-03"
["provider"]=>
string(5) "Provider_2"
I need the results to count the total of "addedCount" where "dateAdded" and "provider" match so that the final array looks like:
addedCount dateAdded provider
3 2012-03-03 provider_1
2 2012-03-03 provider_2
I've tried tirelessly searching SO and rebuilding the arrays, but after many hours spent, I ended up rebuilding the array in its original form,
Thank you in advance!