I have this code:
$sdf = mysql_query("SELECT * FROM users WHERE (DATE(date) = date_sub(date('2013-11-02 00:00:00'), INTERVAL 1 WEEK)) ORDER BY id DESC LIMIT 5");
And would like to get this week's users.. how many who have created an account this week. Now it add's one week from today to next monday. BUT. I want JUST this week, not 7 days forward. How can I do this?
I think
date_format
is enough for what you need.http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_date-format