#42399 [Opn->Bgs]: myqli_query causes error after calling mysql procedures

From: Date: Thu, 23 Aug 2007 14:58:19 +0000
Subject: #42399 [Opn->Bgs]: myqli_query causes error after calling mysql procedures
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116558@lists.php.net to get a copy of this message
ID: 42399 Updated by: jani@php.net Reported By: mfeldheim at gmail dot com -Status: Open +Status: Bogus Bug Type: MySQLi related Operating System: Linux Debian PHP Version: 5.2.3 New Comment: See bug #32882 and bug #35203 Previous Comments: ------------------------------------------------------------------------ [2007-08-23 14:51:29] mfeldheim at gmail dot com Description: ------------ After calling a mysql stored procedure with mysqli_query I get the error "Commands out of sync; you can't run this command now" with the following mysqli_query execution. That is independent from mysqli_query resultmode parameter or a postquery $result->close(); In my case the mysql procedure returns a resultset - didnt test for the case of no resultset Reproduce code: --------------- $mysqli = new mysqli($host, $user, $password, $database); $result = $mysqli->query('CALL mysql_stored_procedure(abc)'); if( $mysqli->errno ) die( $mysqli->error ); while( $data = $result->fetch_object() ): print_r( $data ); endwhile; $result->close(); $result = $mysqli->query('SELECT column1, column2 FROM table WHERE id = 1'); if( $mysqli->errno ) die( $mysqli->error ); while( $data = $result->fetch_object() ): print_r( $data ); endwhile; $result->close(); $mysqli->close(); Expected result: ---------------- mysqli_result ( resultset for the first query ) mysqli_result ( resultset for the second query ) Actual result: -------------- mysqli_result ( resultset for the first query ) Commands out of sync; you can't run this command now ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42399&edit=1

« previous php.bugs (#116558) next »