ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


Action unknown: siteexport_addpage
v5:reference:loadbalancer:setsessioninitsql

setSessionInitSql

Applies To

ADOdb Load Balancer

Syntax
 void setSessionInitSql(
       string $sql
       )

Description

The method setSessionInitSql() adds to the list of SQL statements that are executed as soon as an ADOdb database connection is established and added to the connection pool. There is no limit to the number of statements that can be added to the list. The method must be called after the load balancer object is instantiated but before the ADOdb object is added to the pool. The statements are executed in the order that they are added to the list.


Usage

$db = new ADOdbLoadBalancer;
 
$db->setSessionInitSql('STATEMENT 1');
$db->setSessionInitSql('STATEMENT 2');
 
$driver   = 'mysqli';
$database = 'employees';
$user     = 'adodb';
$password = 'adodb';
$host     = '192.168.0.200';
$db_connection_obj = new ADOdbLoadBalancerConnection( 
    $driver,
    'write',
     10, 
     false, 
     $host, 
     $user, 
     $password, 
     $database ); //Master with weight of 10
v5/reference/loadbalancer/setsessioninitsql.txt · Last modified: 2017/04/25 01:07 by mnewnham