Jump to content

Archived

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

tjhilder

transfer mysql data to another table?

Recommended Posts

Hi,

 

say you have a table called news and then a table called archives, and you want to transfer the data from news to archives, is this possible? I want to be able to transfer it by ticking the news you want transfered then clicking a button (i get all that fine) just wondering how i would go about transfering it, is it possible?

 

thanks in advance.

Share this post


Link to post
Share on other sites

Alternatively, "INSERT INTO archives SELECT * FROM news", and then "DELETE * FROM news WHERE uid<(SELECT MAX(uid) FROM archives)".

Share this post


Link to post
Share on other sites

[!--quoteo(post=333662:date=Jan 5 2006, 04:05 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jan 5 2006, 04:05 PM) 333662[/snapback][/div][div class=\'quotemain\'][!--quotec--]

Alternatively, "INSERT INTO archives SELECT * FROM news", and then "DELETE * FROM archives WHERE uid=(SELECT MAX(uid) FROM archives)".

 

Why delete archived news :)

 

I thought the basic ideas was to insert old news into archives and delete them from the news table

Share this post


Link to post
Share on other sites

Yeah, yeah, my bad, I fixed my previous post.

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.