How can I automatically delete a record from the MYSQL database when it reaches a deadline? remembering I'm using a date_termino attribute of type Date
How can I automatically delete a record from the MYSQL database when it reaches a deadline? remembering I'm using a date_termino attribute of type Date
DELETE FROM table WHERE data_termino < '2017-09-21 00:00:00';
or if it's a date, use > .. and so on.
You can do something more automated eg: (last 6 months)
delete from table where data_termino name < DATE_SUB(NOW() , INTERVAL 6 MONTH)
If you want a range use BETWEEN