File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,12 @@ If no table prefix were set during object creation its possible to set it later
7878$db->setPrefix ('my_');
7979```
8080
81+ If connection to mysql will be dropped Mysqlidb will try to automatically reconnect to the database once.
82+ To disable this behavoir use
83+ ``` php
84+ $db->autoReconnect = false;
85+ ```
86+
8187If you need to get already created mysqliDb object from another class or function use
8288``` php
8389 function init () {
@@ -92,6 +98,24 @@ If you need to get already created mysqliDb object from another class or functio
9298 }
9399```
94100
101+ ### Multiple database connection
102+ If you need to connect to multiple databases use following method:
103+ ``` php
104+ $db->addConnection('slave', Array (
105+ 'host' => 'host',
106+ 'username' => 'username',
107+ 'password' => 'password',
108+ 'db'=> 'databaseName',
109+ 'port' => 3306,
110+ 'prefix' => 'my_',
111+ 'charset' => 'utf8')
112+ );
113+ ```
114+ To select database use connection() method
115+ ``` php
116+ $users = $db->connection('slave')->get('users');
117+ ```
118+
95119### Objects mapping
96120dbObject.php is an object mapping library built on top of mysqliDb to provide model representation functionality.
97121See <a href =' dbObject.md ' >dbObject manual for more information</a >
You can’t perform that action at this time.
0 commit comments