Statistics based on MySQL and PHP

I'm about to generate some statistics based on the values of a MySQL table. I would like to generate some numbers foreach month of the year and foreach day of the month.

I could of course do all this manually but that doesn't seem like a good approach :) So anybody who has some ideas on how i generate these statistics.

OBS. I would like to get all month of the year even if there isn't any MySQL record for a given month.

BONUS: I got a little bonus question. The table which provides the data for the stats will get about 1000 records per week. I my head that seems like a bad approach over time. Anyone who has a suggestion for a better approach is welcomed. I've thought about creating CSV files instead.

In advance thanks a lot. It's appreciated!

EDIT: As asked for

+---------------+------------+------+-----+-------------------+----------------+
| Field         | Type       | Null | Key | Default           | Extra          |
+---------------+------------+------+-----+-------------------+----------------+
| id            | int(11)    | NO   | PRI | NULL              | auto_increment |
| member_id     | int(4)     | NO   |     | 0                 |                |
| status        | tinyint(1) | NO   |     | 0                 |                |
| timestamp     | timestamp  | NO   |     | CURRENT_TIMESTAMP |                |
+---------------+------------+------+-----+-------------------+----------------+
1
задан nickifrandsen 23 September 2010 в 08:16
поделиться