I am not familiar with the vBulletin database structure, but you should do something like this if your user table has a date / datetime / timestamp created_date or reg_timestamp or something similar using MySQL YEAR () and MONTH () functions .
select count(*) as count, year(reg_timestamp) as year month(reg_timestamp) as month from users group by year, month;
This will lead to something like this:
+-------+-------+------+ | count | month | year | +-------+-------+------+ | 4 | 11 | 2008 | | 1 | 12 | 2008 | | 196 | 12 | 2009 | | 651 | 1 | 2010 | +-------+-------+------+
Edit: regarding Dave's comment: The vBulletin date seems to be stored in Unixtime format. In this case, just wrapping the column using FROM_UNIXTIME converts it to a readable MySQL date:
select count(*) as count, year(from_unixtime(reg_timestamp)) as year month(from_unixtime(reg_timestamp)) as month from users group by year, month;
source share