Calculate Last Week, Last Month in Mysql

We need get datas from last week, last month, yesterday and today. We can do it easily in MySQL.

Getting Current Date

SELECT CURDATE();

Result : 2009-06-04

Getting Last Week Datas

SELECT DATE_ADD('2009-06-04', INTERVAL 7 DAY);

Getting Last Month Datas

SELECT DATE_ADD('2009-06-04', 1 MONTH);

Getting Last Year Datas

SELECT DATE_ADD('2009-06-04', INTERVAL 1 YEAR);

And Php example for this calculations, getting last month orders

mysql_query("SELECT * FROM orders WHERE DATE_SUB(CURDATE(),INTERVAL 1 month) <= order_date")); 

For more information of Date and time functions :
http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html