19
I’m making a BD query, and I want to receive results from the last 7 days from the current date. For that, I have a field data
of type DATA (yyyy-mm-dd) in table. I am doing the query in php, in turn mysql.
$query = mysql_query(SELECT * FROM tbl_registos WHERE data >= '$last_7_days');
The variable $last_7_days
should be the value of the last 7 days, always taking into account the months and years. There is some easier way to do this?
Thank you for the reply! ;)
– pc_oc