Mailinglisten-Archive |
Hi Avi,
Am Montag, 12. Dezember 2005 11:55 schrieb Irani, Amir:
> Ich habe eine sehr einfache SP unter mysql5.0.16 die so aussieht:
>
> CREATE PROCEDURE p1()
> SELECT * FROM table;
>
> Bei dem Versuch die SP aufzurufen mit php 4.3.9 mit
>
> CALL p1();
>
> Bekomme ich folgenden Fehler :
> can't return a result set in the given context
>
> Hat bereits einer von euch den selben Versuch gemacht unter php4 und hat
> die Lösung ?
das ist doch eigentlich eine MySQL-Frage... ;-)
"For statements that can be determined only at runtime to return a result set,
a PROCEDURE %s can't return a result set in the given context error occurs
(ER_SP_BADSELECT)."
-> http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html
Damit ein Bißchen gegoogelt, bringt z.B. diesen Link zu Tage:
http://forums.mysql.com/read.php?98,57708,57708
Dort ist steht folgende Lösung:
"To solve it I had to read the source code of MySQL5 and found the errorcode
ER_SP_BADSELECT, and then the place where the error will be sent -
sql_parse.cpp - checking if CLIENT_MULTI_RESULTS is set. I have found the
values of the constants and passed them to MySQL - it works!
The example code you can find here:
http://www.ratchinski.com/dev/mysql5/test.php.txt"
Und in dem Beispiel steht zu lesen:
// define that client supports the multiple statements
define('CLIENT_MULTI_STATEMENTS',65536);
// define that client supports multiple results
define('CLIENT_MULTI_RESULTS',131072);
Probier das mal aus. :-)
Viele Grüße
Lutz
php::bar PHP Wiki - Listenarchive