1

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?

2 Answers2

0

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.

fancyPants
  • 50,732
  • 33
  • 89
  • 96
0

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.

Community
  • 1
  • 1
Wilmer
  • 448
  • 2
  • 4