|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-08-23 14:58 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 03:00:01 2025 UTC |
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