Hi, I have the following schema.
Table votes
+------------------+--------------+------+-----+---------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------------------+----------------+
| id | int(10) | NO | PRI | NULL | auto_increment |
| aid | varchar(10) | NO | | | |
| ip | varchar(100) | NO | | | |
| host | varchar(200) | NO | | | |
| timestamp | varchar(20) | NO | | 0000-00-00 00:00:00 | |
| user | tinytext | NO | | NULL | |
| userid | int(10) | NO | | 0 | |
+------------------+--------------+------+-----+---------------------+----------------+
Here I want to get the count of each aid on a day for the last 7 days with "0"s for the dates where there a no votes for aid. timestamp is unix timestamp here.
Any help is highly appreciated.