ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:loadbalancer:clusterexecute

This is an old revision of the document!


clusterExecute

Applies To

ADOdb Load Balancer

Syntax
mixed clusterExecute(
  string $sql,
  optional bool $inputArray = false,
  optional bool $returnAllResults = false,
  optional bool $existingConnectionsOnly = true
)

Description

The method clusterExecute() is used to simultaneously execute an SQL statement across all nodes in the load balancing group. It is primarily used for setting Server parameters.


Parameters

The first two parameters follow the rules as specified in the ADOdb execute() command.

$returnAllResults

The default behavior of the command is to return the result of the execution of the command from first connected server in the pool. If the parameter is set to true, then the results of all executions are collected into an array and returned as a numeric array, ordered by connection.

$existingConnectionsOnly

Usage

/*
* connection to load balancer assumed
*/
 
$SQL = "SET SESSION TIME ZONE";
 
$success = $db->clusterExecute($SQL);
v5/reference/loadbalancer/clusterexecute.1492570223.txt.gz · Last modified: 2017/04/21 11:37 (external edit)