hi,
Just a couple suggestions on how to redesign your database. You could create 2 tables the first one would manage all your banners and the second could hold the click and a timestamp for each banner id.
Here is just an example (these will not compile because some syntax is incorrect)
banners {
pk_id int not null autoincrement,
name var(50) not null,
active bit(1) default "0",
timestamp datetime
};
banner_clicks {
pk_id int not null autoincrement,
fk_banner_id int not null,
timestamp datetime
};
Using this example you can insert banners into the banners table and then using your ad tracking software insert a banner impression into the banner_clicks based on the banner.pk_id
This will allow the tables to grow and you will not have to reset anything anytime. This will also allow you to select an entire month or months based on the number of clicks for each banner per month.
Or you can check out phpadsnew at http://www.phpadsnew.com/one/ it has awesome support and it activly maintained but might be a little overkill 🙂
Thanks
- Justin