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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.