Basically I want to truncate a table every X days but I don’t want to use cron. I would like to have a kind of built in script inside the php file to do this and maybe sql triggers can help me out. Unfortunately I don’t know how to use them.
Share
Depending on the version of MySQL, you might have access to CREATE EVENT which allows MySQL to trigger its own processes at scheduled times.
e.g.
To run a task each day
Other databases may have equivalents, though you don’t identify the database that you’re using.