How to delete mysql row after time passes?

后端 未结 6 777
闹比i
闹比i 2020-11-29 01:56

I have no idea where to start with this one:

I have a database that stores postID and Date.

What I want to do is have my website au

6条回答
  •  暖寄归人
    2020-11-29 02:21

    You should set cron job (scheduled tack.) for it.

    A cron job is an automated program setup for Linux and Unix operating systems. It allows the user to execute several commands or functions at a specific time and date.

    you have cron Job in your cpanel setup. first you need to make a php script with your logic for delete record after each date. take date from server and write script for delete.

    then go to cron tab in your cpanel and do settings for time interval to run cron and give path of your php script file.

提交回复
热议问题