php - MySQL Error: Commands out of sync; you can't run this command now -
mysql error: commands out of sync; can't run command now
i above error when try execute sql procedure more once each time.
i've found has "store result", i've been trying figure out while, haven't succeeded yet.
here php code:
$query = "call getobjectsvalue(".$formid.")"; if( $res = $mysqli->query($query) ) { $mysqli->store_result(); while ($row = $res->fetch_assoc()) { ... } $res->free(); }
for reason, recordset stored procedures 1 has loop through using next_result() command. not case if recordset comes directly execution of sql query (select).
$query="call getobjectsvalue($formid)"; if($res=$mysqli->query($query)) { { $row = $res->fetch_assoc() ... } while($mysqli->next_result()); //loop through recordset $res->free(); }
Comments
Post a Comment