uknowho008 Posted December 8, 2006 Share Posted December 8, 2006 im trying to find a good system for tranfering data from one database to another database with a different table orginization. so i need to get the data from one and then insert it into another database but broken up into different tables that ive created. does anybody have a good system for this? my biggest obsticle is switching between the two databases. Link to comment https://forums.phpfreaks.com/topic/29879-database-transfering/ Share on other sites More sharing options...
artacus Posted December 8, 2006 Share Posted December 8, 2006 Are the two databases on the same db server? If so you can copy it over with a single sql statement like so:INSERT INTO other_db.table1 SELECT stuff FROM table3If they are on separate servers, you will need two connections:$dbcon1 = mysql_connect();$dbcon2 = mysql_connect();And you'll need to specify which server when you do a query$result = mysql_query($query,$dbcon1); Link to comment https://forums.phpfreaks.com/topic/29879-database-transfering/#findComment-137298 Share on other sites More sharing options...
uknowho008 Posted December 8, 2006 Author Share Posted December 8, 2006 yes they're on the same server. i thought it was going to have to be way more complicated than that. thanks. Link to comment https://forums.phpfreaks.com/topic/29879-database-transfering/#findComment-137303 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.