Not sure how to ask this, but let me give you my problem:
I have a table with 50 000 records, in one column (named recorded_at) a timestamp. Now what I would like to have a SQL SELECT query (processed with PHP) that results in an array with the total per days. So the result would look like:
$array["2012-01-01"] = 4;
$array["2012-01-02"] = 14;
$array["2012-01-03"] = 45;
$array["2012-01-04"] = 33;
And so on…
I could of course loop through 365 days a year and SELECT 365 times, but that seems very inefficient. Any idea how to do this?
Try this: