if i have a datetime column in a mysql table, how would i count how many records were inserted for $thisweek, $lastweek, $thismonth and then $lastmonth?
You can use
SELECT count(column) FROM tablename WHERE timestamp BETWEEN $then AND $now