Forum Moderators: coopster
select count(*) from pageviews where article_id='$some_id' and date >= date_sub(curdate(), interval 7 day) and date < curdate();
Note this only gets the last 7 days and may not be "last week." To do that, you'll have to get and store the actual dates of the first and last days of "last week," store those dates in variables, and use them in the >= and <. It's a little complex but once you have it, it's done.