blakekr Posted January 29, 2007 Share Posted January 29, 2007 Okay, I understand the idea of the "insert into... select..." statement,and the idea of the mysql_select_db function ...but I still can't figure out how to take a few rows in table Foo in database A and copy them into table Foo in database B.Your help appreciated! Quote Link to comment Share on other sites More sharing options...
artacus Posted January 30, 2007 Share Posted January 30, 2007 So say your selected database is A (mysql_select_db('A',$conn)).If the databases are on the same server, it's pretty easy:INSERT INTO b.foo ...or from "B":INSERT INTO foo ... SELECT * FROM a.fooIf the db's are on different servers, you'll have to use PHP to establish a connection to both and extract and insert the data manually. Quote Link to comment Share on other sites More sharing options...
blakekr Posted January 30, 2007 Author Share Posted January 30, 2007 Aha, thanks so much!! Will try (and mark resolved if I don't have more questions) 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.