v5:reference:loadbalancer:addconnection
This is an old revision of the document!
addConnection
Applies To
ADOdb Load Balancer
See Also
Syntax
bool addConnection( object $ADOdbConnection )
Description
The method addConnection()
adds an ADOdb connection, created by the instantiation of the ADOdbLoadBalancerConnection() class to the load balancer connection pool. Until the connection is added to the pool it cannot be used by the load balancer.
Note that a connection to the database is not established until the first command is executed.
Usage
$db = new ADOdbLoadBalancer(); $driver = 'mysqli'; $database = 'employees'; $user = 'adodb'; $password = 'adodb'; $host = '192.168.0.200'; $db0 = new ADOdbLoadBalancerConnection( $driver, 'write', 10, false, $host, $user, $password, $database ); /* * Add the connection to the pool */ $db->addConnection( $db0 );
v5/reference/loadbalancer/addconnection.1492648465.txt.gz · Last modified: 2017/04/21 11:37 (external edit)