Reputation: 364
I want to make a table where the entries expire 24 hours after they have been inserted in PHP and MySQLi/MySQL on a Linux server. I am using it for my program which will upload data to the server for transferring to another computer - but to save on storage and reduce server load I want to make so that the data will expire after 24 hours. It works like this:
I could use a cron job to run a php file every hour but that could increase server load especially because my server is going to be used for lots of other things and there is probably a better way in MySQLi.
Also, the programming language I am using is not that capable of doing it client-side and SSL is not available on on my server.
Upvotes: 0
Views: 143
Reputation: 9034
Use a cron job which runs once a day and deletes all entries that are older than 24 hours.
Upvotes: 2