Hi, i have two ODBC connection in SC:
- conn_a
- conn_b
In a blank app i wanto to execute some query on all my connection, first on conn_a, then on conn_b.
This is my code:
for ($i = 1; $i <= 2; $i++) {
//sc_reset_change_connection ();
if ($i == 1){
//conn_a
$connection = "conn_a";
} else {
//conn_b
$connection = "conn_b";
}
$sqlString = "SELECT
codicegruppo,
idTemplate
FROM slam_auto_spedisci
WHERE spedisci = 1";
sc_select(my_data_gruppi, $sqlString, $connection);
if ({my_data_gruppi} === false){
echo "Access 1 error. Message=". {my_data_gruppi_erro} ;
} elseif (empty({my_data_gruppi})){
echo "Select 1 command didn't return data";
} else {
.....
}
Php return to me this error:
[Tue Feb 09 11:58:54.054149 2016] [:error] [pid 1473] [client ::1:47652] PHP Parse error: syntax error, unexpected ',' in /srv/http/scriptcase/app/tabulatostatusordini/esportazione_ordini_agenti/index.php on line 1174, referer: http://localhost/scriptcase/devel/iface/editor.php?randjs=ARRdVQ5CZMllAgT4
and this is my index.php, first line 1174
...
$nm_select = $sqlString,$connessione;
$_SESSION['scriptcase']['sc_sql_ult_comando'] = $nm_select;
$_SESSION['scriptcase']['sc_sql_ult_conexao'] = '';
if ($this->my_data_gruppi_agenti = $this->Db->Execute($nm_select))
...
Why this error?
There is a better way?
Thanks.