Lambneck Posted September 27, 2008 Share Posted September 27, 2008 Is there a way to put a time limit on how long information is stored in a database? For example: User submits form data to database. It is stored there for 30 days, then after that 30 days is automatically deleted from database table. Link to comment https://forums.phpfreaks.com/topic/126022-temporary-storage/ Share on other sites More sharing options...
JasonLewis Posted September 27, 2008 Share Posted September 27, 2008 You would need to use a Cron Job that would run daily to check for information that is 30 days or older, then delete it from the database. Link to comment https://forums.phpfreaks.com/topic/126022-temporary-storage/#findComment-651700 Share on other sites More sharing options...
vbnullchar Posted September 27, 2008 Share Posted September 27, 2008 you add an extra field in you db that contains the timestamp of the date it was submitted.. then setup a cron that deletes record if date is more than 30dys Link to comment https://forums.phpfreaks.com/topic/126022-temporary-storage/#findComment-651701 Share on other sites More sharing options...
Lambneck Posted September 27, 2008 Author Share Posted September 27, 2008 Could it be done through the UPDATE statement? ex. <?php UPDATE $tablename DELETE * WHERE $submission_date == "+30" ?> ...or something like that Link to comment https://forums.phpfreaks.com/topic/126022-temporary-storage/#findComment-651714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.