Jump to content

Archived

This topic is now archived and is closed to further replies.

digitalgod

archiving

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
[!--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?

Share this post


Link to post
Share on other sites
yes, you can setup a cron job which will then execute your php script every 24hours.

Share this post


Link to post
Share on other sites
[!--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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.