Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i auto delete a row of data in my database after 15days?

i want the site(if possible the database itself) to delete a row data in the database, without interacting with the site like opening or loading it.

i searched some tutorials/post but i only saw codes that need to be interacted.

Thanks.

Sorry for the bad English.

like image 275
Christian Eric Paran Avatar asked Nov 23 '25 23:11

Christian Eric Paran


2 Answers

Run a cronjob or other scheduled process on your server

like image 74
Igy Avatar answered Nov 25 '25 14:11

Igy


If you don't have access to cronjob you could run a small script at the bottom of a website. With the script, you check when the script was last run and if it's 15 days ago, check the dates of the rows in the database.

But, cronjob is easier, better and preferred.

like image 36
Victor Bjelkholm Avatar answered Nov 25 '25 14:11

Victor Bjelkholm



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!