I'm trying to copy some data between different databases. For testing i used simply two databases both on localhost and everything worked fine but as soon as I try to establish the connection to two different hosts it doesn't work anymore. My code looks like this:
$sourceDb = new ezSQL_mysql($settings['dbuser'], $settings['dbpass'], $settings['dbname'], $settings['dbhost']);
$targetDb = new ezSQL_mysql($settings['syncdbuser'], $settings['syncdbpass'], $settings['syncdbname'], $settings['syncdbhost']);
And the error message is this:
Warning: Error establishing mySQL database connection.
Correct user/password? Correct hostname?
Database server running? in ez_sql_mysql.php on line 89
PHP Warning: mySQL database connection is not active
in ez_sql_mysql.php on line 121
Is there any problem I'm not aware of, that prevents two connections to different hosts?
Btw. the connection information is 100% correct.. if I only use one connection everything works without any problems!
I still don't know why I got this error. Switched to PDO and have no problems..