As I do so that the records of a table in my MySql database are deleted every 24 hours automatically without using cronjobs.
Pd: use php.
Greetings.
As I do so that the records of a table in my MySql database are deleted every 24 hours automatically without using cronjobs.
Pd: use php.
Greetings.
If you have administrator access to your MySQL and you can enable the event scheduler , then you can schedule periodic events of the form:
CREATE EVENT limpieza
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO
TRUNCATE TABLE esquema.tabla;
Or
CREATE EVENT limpieza
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO
DELETE FROM esquema.tabla WHERE creacion < (CURRENT_TIMESTAMP - INTERVAL 1 DAY);
It's still a kind of cronjob, but at least it runs internally.