Hello. I'm using the last version of Adodb (27-abril-2009). I have this php code:
[INDENT]<?php
echo "dum";
echo "test";
error_reporting(E_ALL);
require_once("adodb/adodb.inc.php");
echo "Conectando\n";
$DB = ADONewConnection("mysqli");
$DB->optionFlags["CLIENT_MULTI_RESULTS"] = array( /CLIENT_MULTI_RESULTS/0x20000, 1);
$DB->Connect("localhost","root","xxxx","bd_ex1");
echo "Conectado\n";
$DB->debug = true;
$rs = $DB->Execute("call estadisticasServ();");
if ($rs) {
print "<pre>";
print_r($rs->GetRows());
print "</pre>";
} else {
print "NO";
}
?> [/INDENT]
And SP estadisticasServ is a simple select "a":
[INDENT]CREATE PROCEDURE estadisticasServ()
BEGIN
select "a";
END;
mysql> CALL estadisticasServ();
+---+
| a |
+---+
| a |
+---+[/INDENT]
The SP is OK.
I have modifiqued the file 'adodb-mysqli.inc.php'.
foreach($this->optionFlags as $arr) {
mysqli_options($this->connectionID,$arr[0],$arr[1]);
print "Opcion: $arr[0] .Valor: $arr[1]\n";
}
print "mysql_real_connect\n";
$ok = mysqli_real_connect($this->connectionID,
Stdout from script php:
[INDENT]php a.php
dumtestConectando
Opcion: 5 .Valor: 0
Opcion: 131072 .Valor: 1
mysql_real_connect
Conectado
-----<hr>
(mysqli): call estadisticasServ();
-----<hr>
Query: call estadisticasServ(); failed. PROCEDURE cidaut_prg.estadisticasServ can't return a result set in the given context
1312: PROCEDURE cidaut_prg.estadisticasServ can't return a result set in the given context
ADOConnection._Execute(call estadisticasServ();, false)% line 1017, file: /srv/www/htdocs/v_actual/platweb/tmp1/adodb/adodb.inc.php
ADOConnection.Execute(call estadisticasServ()😉% line 12, file: /srv/www/htdocs/v_actual/platweb/tmp1/a.php
NO
[/INDENT]
Why don't work correctly if i set option flag CLIENT_MULTI_RESULTS?
Thank for any help.
Regards