ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:loadbalancer:addconnection

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
v5:reference:loadbalancer:addconnection [2017/04/18 04:37] – ↷ Links adapted because of a move operation 54.167.41.20v5:reference:loadbalancer:addconnection [2017/04/20 01:26] mnewnham
Line 5: Line 5:
 ADOdb Load Balancer ADOdb Load Balancer
 == See Also == == See Also ==
-[[v5:reference:loadbalancer:getadodbobject|ADOdbLoadBalancerConnection()]]\\ +[[v5:reference:loadbalancer:adodbloadbalancerconnection|ADOdbLoadBalancerConnection()]]\\
-[[v5:reference:loadbalancer:getadodbobject|getADODbObject()]]+
 == Syntax == == Syntax ==
    bool addConnection(    bool addConnection(
Line 14: Line 13:
 </WRAP> </WRAP>
 ===== Description ===== ===== Description =====
-The method ''addConnection()'' adds an ADOdb connection, created by the instantiation of the [[v5:reference:loadbalancer:getadodbobject|ADOdbLoadBalancerConnection()]] class and retrieved by the [[v5:reference:loadbalancer:getadodbobject|getADODbObject()]] method to the load balancer connection pool. Until the connection is added to the pool it cannot be used by the load balancer. +The method ''addConnection()'' adds an ADOdb connection, created by the instantiation of the [[v5:reference:loadbalancer:getadodbobject|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 ==== ===== Usage ====
 <code php> <code php>
 +$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 );
 </code> </code>
  
v5/reference/loadbalancer/addconnection.txt · Last modified: 2017/04/25 01:08 by mnewnham