v5:reference:loadbalancer:clusterexecute
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
v5:reference:loadbalancer:clusterexecute [2017/04/15 19:59] – mnewnham | v5:reference:loadbalancer:clusterexecute [2017/04/21 11:50] – external edit 127.0.0.1 | ||
---|---|---|---|
Line 17: | Line 17: | ||
===== Parameters ===== | ===== Parameters ===== | ||
The first two parameters follow the rules as specified in the ADOdb [[v5: | The first two parameters follow the rules as specified in the ADOdb [[v5: | ||
- | ===== Usage ==== | + | ===== $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 ordered by connection. | ||
<code php> | <code php> | ||
/* | /* | ||
- | * connection to load balancer assumed | + | * Connection pool with 3 MySQL servers |
*/ | */ | ||
+ | $a = $db-> | ||
+ | | ||
+ | | ||
+ | | ||
+ | print_r($a); | ||
+ | /* | ||
+ | * Returns | ||
+ | Array | ||
+ | ( | ||
+ | [0] => ADORecordSet_empty Object | ||
+ | ( | ||
+ | [dataProvider] => empty | ||
+ | [databaseType] => | ||
+ | [EOF] => 1 | ||
+ | [_numOfRows] => 0 | ||
+ | [fields] => | ||
+ | [connection] => | ||
+ | ) | ||
- | $SQL = "SET SESSION TIME ZONE"; | + | [1] => ADORecordSet_empty Object |
+ | ( | ||
+ | [dataProvider] => empty | ||
+ | [databaseType] => | ||
+ | [EOF] => 1 | ||
+ | [_numOfRows] => 0 | ||
+ | [fields] => | ||
+ | [connection] => | ||
+ | ) | ||
- | $success | + | [2] => ADORecordSet_empty Object |
+ | | ||
+ | [dataProvider] => empty | ||
+ | [databaseType] => | ||
+ | [EOF] => 1 | ||
+ | [_numOfRows] => 0 | ||
+ | [fields] => | ||
+ | [connection] => | ||
+ | | ||
+ | ) | ||
+ | */ | ||
+ | |||
+ | $a = $db-> | ||
+ | | ||
+ | true, | ||
+ | | ||
+ | print_r($a); | ||
+ | /* | ||
+ | * Returns | ||
+ | ADORecordSet_empty Object | ||
+ | ( | ||
+ | [dataProvider] => empty | ||
+ | [databaseType] => | ||
+ | [EOF] => 1 | ||
+ | [_numOfRows] => 0 | ||
+ | [fields] => | ||
+ | [connection] => | ||
+ | ) | ||
+ | */ | ||
</ | </ | ||
+ | ===== $existingConnectionsOnly ==== | ||
+ | If the '' | ||
v5/reference/loadbalancer/clusterexecute.txt · Last modified: 2017/04/25 01:11 by mnewnham