using PHP, how to copy selected records from one mysql database to another on different hosts (so different connections)?
- I coded separate mysqli connections
- The databases both have the same structure
I use this new script to select some records from sourceDB.table and copy them to targetDB.table if their record number does not already exist. What puzzled me were the separate connections.
Something like this (or whatever you suggest), but with separate mysqli connection handling:
INSERT INTO targetDB.table SELECT sourceDB.table.* FROM sourceDB.table LEFT JOIN targetDB.table USING(id) WHERE targetDB.table.id IS NULL