mysql select last week posts count
In mysql to select the last 7 days posts or its count the following query is used.
select count(*) from posts where date > DATE_SUB(NOW(), INTERVAL 7 DAY)
In the above query date
is the user defined column specifying the date.