Jump to content

database transfering


uknowho008

Recommended Posts

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

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 table3

If 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

Archived

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

×
×
  • Create New...

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.