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. Quote Link to comment 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); Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.