ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:loadbalancer:addconnection

This is an old revision of the document!


addConnection

Applies To

ADOdb Load Balancer

See Also

ADOdbLoadBalancerConnection()

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.


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.1492644313.txt.gz · Last modified: 2017/04/21 11:37 (external edit)