I want to produce a report that counts the number of records that are entered into our database on a weekly basis. Is there a way, just using MySQL, that I can loop through a year's worth of dates, doing a total for each of the 52 weeks? Or do I have to capture all of the data and then parse in a "for" loop in PHP? If the latter, can you help with the PHP code? If the former, can you supply the SQL syntax?
Here is what I have so far:
SELECT DateEntered,Count(ID) AS Total FROM Applications WHERE DateEntered Between '2007-01-01' AND '2007-01-06' Group By DateEntered