digitalgod Posted June 4, 2006 Share Posted June 4, 2006 hey guys,I was wondering what would be the most efficient way to archive a MySQL table. I have a table that has over 100 entries added to it per day, I need to archive them somewhere to be able to review them later. Link to comment https://forums.phpfreaks.com/topic/11194-archiving/ Share on other sites More sharing options...
stephenk Posted June 5, 2006 Share Posted June 5, 2006 You could maybe loop through the table each day and select entries that are more than 3 days old. Use a PHP script to grab the entries from the main table, insert them into the archive table then delete them on the main table.Stephen Link to comment https://forums.phpfreaks.com/topic/11194-archiving/#findComment-41981 Share on other sites More sharing options...
digitalgod Posted June 5, 2006 Author Share Posted June 5, 2006 [!--quoteo(post=380161:date=Jun 5 2006, 07:07 AM:name=stephenk)--][div class=\'quotetop\']QUOTE(stephenk @ Jun 5 2006, 07:07 AM) [snapback]380161[/snapback][/div][div class=\'quotemain\'][!--quotec--]You could maybe loop through the table each day and select entries that are more than 3 days old. Use a PHP script to grab the entries from the main table, insert them into the archive table then delete them on the main table.Stephen[/quote]hey Stephen,is there a way to make an automatic process without having to run that script myself every day? Link to comment https://forums.phpfreaks.com/topic/11194-archiving/#findComment-42040 Share on other sites More sharing options...
wildteen88 Posted June 5, 2006 Share Posted June 5, 2006 yes, you can setup a cron job which will then execute your php script every 24hours. Link to comment https://forums.phpfreaks.com/topic/11194-archiving/#findComment-42073 Share on other sites More sharing options...
digitalgod Posted June 5, 2006 Author Share Posted June 5, 2006 [!--quoteo(post=380256:date=Jun 5 2006, 12:56 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 5 2006, 12:56 PM) [snapback]380256[/snapback][/div][div class=\'quotemain\'][!--quotec--]yes, you can setup a cron job which will then execute your php script every 24hours.[/quote]yeah that's what I thought but wasn't sure.thanks guys Link to comment https://forums.phpfreaks.com/topic/11194-archiving/#findComment-42075 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.