Question

Basically, If a value in Row is same for 3 days I want to remove the column, like if someone hasn't verified their account remove the account to save space.

Is there a way to make a script for this? If so can someone help me make it?

No correct solution

OTHER TIPS

Have a column like

modified timestamp default current_timestamp on update current_timestamp

in your table. Then write a query to delete entries of the table and execute it via event scheduler.

You can setup a cron job to run every day and execute this query on the database:

DELETE FROM table WHERE insert_date BETWEEN DATE_SUB(NOW(), INTERVAL 3 DAY) AND NOW();

Note: similar problem here.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top