tjhilder Posted January 5, 2006 Share Posted January 5, 2006 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. Link to comment https://forums.phpfreaks.com/topic/3152-transfer-mysql-data-to-another-table/ Share on other sites More sharing options...
LazyJones Posted January 5, 2006 Share Posted January 5, 2006 Sure is possible. Select from news -> Insert into archives -> (delete old news) Link to comment https://forums.phpfreaks.com/topic/3152-transfer-mysql-data-to-another-table/#findComment-10649 Share on other sites More sharing options...
fenway Posted January 5, 2006 Share Posted January 5, 2006 Alternatively, "INSERT INTO archives SELECT * FROM news", and then "DELETE * FROM news WHERE uid<(SELECT MAX(uid) FROM archives)". Link to comment https://forums.phpfreaks.com/topic/3152-transfer-mysql-data-to-another-table/#findComment-10650 Share on other sites More sharing options...
LazyJones Posted January 5, 2006 Share Posted January 5, 2006 [!--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 Link to comment https://forums.phpfreaks.com/topic/3152-transfer-mysql-data-to-another-table/#findComment-10651 Share on other sites More sharing options...
fenway Posted January 5, 2006 Share Posted January 5, 2006 Yeah, yeah, my bad, I fixed my previous post. Link to comment https://forums.phpfreaks.com/topic/3152-transfer-mysql-data-to-another-table/#findComment-10652 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.