Jump to content


Photo

archiving


  • Please log in to reply
4 replies to this topic

#1 digitalgod

digitalgod
  • Members
  • PipPipPip
  • Advanced Member
  • 374 posts

Posted 04 June 2006 - 10:30 PM

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.

#2 stephenk

stephenk
  • Members
  • PipPipPip
  • Advanced Member
  • 62 posts

Posted 05 June 2006 - 11:07 AM

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

#3 digitalgod

digitalgod
  • Members
  • PipPipPip
  • Advanced Member
  • 374 posts

Posted 05 June 2006 - 02:52 PM

[!--quoteo(post=380161:date=Jun 5 2006, 07:07 AM:name=stephenk)--][div class=\'quotetop\']QUOTE(stephenk @ Jun 5 2006, 07:07 AM) View Post[/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?

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 05 June 2006 - 04:56 PM

yes, you can setup a cron job which will then execute your php script every 24hours.

#5 digitalgod

digitalgod
  • Members
  • PipPipPip
  • Advanced Member
  • 374 posts

Posted 05 June 2006 - 04:58 PM

[!--quoteo(post=380256:date=Jun 5 2006, 12:56 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 5 2006, 12:56 PM) View Post[/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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users