Wondering if its possible to have a file running and checking if a value in database/row

StackOverflow https://stackoverflow.com/questions/21751746

  •  11-10-2022
  •  | 
  •  

문제

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?

올바른 솔루션이 없습니다

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top