I am making a query to DB, and I want to receive results for the last 7 days from the current date. For this, I have a
data field of type DATA (yyyy-mm-dd) in the table. I'm doing the query in php, mysql turn.
$query = mysql_query(SELECT * FROM tbl_registos WHERE data >= '$last_7_days');
$last_7_days should be the value of the last 7 days, always keeping in mind the months and the years. Is there any easier way to do this?