user1710563
user1710563

Reputation: 387

MySQL Database Sync

I have 2 MySQL databases with similar data. The difference is that one has an email column with about 2000 entries and the other has an email column with no entries. Is there some sort of bulk operation that could be done to copy the 2000 email addresses from database 1 to database 2?

I'm looking for a way to do this with PHP, or better yet, an all-inclusive query to run via phpMyAdmin.

Upvotes: 0

Views: 86

Answers (1)

Kermit
Kermit

Reputation: 34055

Something like this:

UPDATE db1.tbl a SET a.email = b.email
JOIN db2.tbl b ON b.id = a.id

Upvotes: 4

Related Questions