So I need to connect to two databases at once then?
Both databases have the same username and password if that makes it easier.
So am I overcomplicating this?
Would this also work?
Code:
$dbh1 = mysql_connect($localhost, $username, $password);
$dbh2 = mysql_connect($localhost, $username, $password, true);
mysql_select_db('database1', $dbh1);
mysql_select_db('database2', $dbh2);
USE `database2`;
INSERT INTO `database1`.`new_table`(`column1`,`column2`,`column3`)
SELECT `old_table`.`column2`, `old_table`.`column7`, `old_table`.`column5`
FROM `old_table`