PHP Mysql:如何将特定记录从一个db插入另一个db不同的服务器?

db 1 Table 1

  1. Name
  2. Dob
  3. Address
  4. ID
  5. Last Updated date

Specific Records(using where condition) from the above table has to be inserted or updated to another db 2 table 2 of different server.

If its only for one time, just do it in any database editing tool like MySQL Workbench or SQLyog.

If you need to do it frequently, do it like this:

  1. get a connection with db 1
  2. fetch all the records needed from db1 table1 and put them in an array
  3. close the connection with db 1 and open a connection with db 2
  4. loop through the array with records and insert/update them in db2
  5. close the connection with db2.

it shouldn't be that hard