You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, i like the way databases are currently handled, however it is lacking the ability to connect to multiple databases, while some people deem this unnecessary as most people stick to one kind of connector(mysql, sqlsrv) and one database, it is a useful feature to be able to connect to multiple connectors and databases within the same script.
I am putting this here as it's not a necessary part and is more feature creep than anything. maybe some one will find it useful
I really like the idea and your code, but as this is only something for the really hardcore users I would like to add this to the upcoming large README, maybe under a section called "optional features (with working code examples)".
Gimme some weeks for this :)
panique
changed the title
[Feature] Connect to multiple database
[FEATURE, cool for readme/documentation!] Connect to multiple database
Sep 7, 2015
He, as this is a feature for very advanced users I'would kindly move this idea to the readme under "feature ideas" and link it from there, so people can still find it (and close this ticket as it's not really a ToDo). Hope that's okay for you :)
Hi, i like the way databases are currently handled, however it is lacking the ability to connect to multiple databases, while some people deem this unnecessary as most people stick to one kind of connector(mysql, sqlsrv) and one database, it is a useful feature to be able to connect to multiple connectors and databases within the same script.
I am putting this here as it's not a necessary part and is more feature creep than anything. maybe some one will find it useful
Usage
this is used pretty much exactly like the only way of doing it with a few extra parameters
$database = DatabaseFactory::getFactory()->getConnection('Connection type', 'Database');
$query = $database->prepare(...);
$query->execute();
$result = $query->fetchAll();
Example
DatabaseFactory::getFactory(true)
true needs to be set if you are changing the connector or database at any point, not doing so will result in the table/connector not being changed
->getConnection('MYSQL', 'Tabel3');
Connector type, table
leaving these blank will return the first database listed in the getConnection method. with the default database from config,
$database = DatabaseFactory::getFactory()->getConnection();
is completely valid and will return the exact same result as it currently does.
The text was updated successfully, but these errors were encountered: