Closed peterblay closed 4 years ago
I have, by trial and error worked a solution. I’m unsure if it is the deemed correct, but it seems to work.
// FIRST CONNECTION use ezsql\Database; $db1 = Database::initialize('mysqli', ['ezsql_user', 'ezsql_password1', 'ezsql_database']);
// SECOND CONNECTION use ezsql\Config; use ezsql\Database\ez_mysqli; $setting = new Config('mysqli', ['mysqli', ['ezsql_user1', 'ezsql_password2', 'ezsql_database1']); $db2= new ez_mysqli($setting);
Yes, that is the correct way, it's the same issue, my over site, and solution raised in https://github.com/ezSQL/ezsql/issues/176
$db = Database::initialize('mysqli', ['ezsql_user', 'ezsql_password123', 'ezsql_database']); $db1 = Database::initialize('mysqli', ['ezsql_user1', 'ezsql_password1234', 'ezsql_database1']);
Referencing either $db or $db1 only returns results from the first connection ($db).
In previous versions 2 / 3, you were able to connect to multple databses this way. I cannot see any documentation referring to multuple connections in version 4.0.