How Can I write a PHP script or MySQL script to do a repetitive task after a period of time? One example of this could be to delete the top row of a specific table in the database every 120 seconds.
Use EVENTS
CREATE EVENT delete_top_event
ON SCHEDULE
EVERY 2 MINUTE
DO
DELETE FROM your_table order by some_column desc limit 1;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With