开发者

Codeigniter/PHP delete row after period of time

开发者 https://www.devze.com 2022-12-17 07:16 出处:网络
Is it possible to delete a SQL 开发者_如何学运维db row after a period of time? ie.I have a row that has an expiration date and it needs to be deleted on that day?

Is it possible to delete a SQL 开发者_如何学运维db row after a period of time?

ie. I have a row that has an expiration date and it needs to be deleted on that day?

If I'm displaying info to a user, is it better practice to just hide "expired" entries and keep the data?


Either way this looks like a job for cron. Just create a cron job that runs daily that either deletes or hides the rows that expire that day. I prefer to hide them for data retention purposes but deleting them might suit your application better. You'll know better then us.


I think you can always call it like this:

Codeigniter/PHP delete row after period of time

Afterwards you go to your cpanel to set a time interval that executes a script periodically.

0

精彩评论

暂无评论...
验证码 换一张
取 消