note 110154 deleted from mysqli.multi-query by danbrown
| From: | danbrown@php.net | Date: | Mon, 24 Sep 2012 19:57:24 +0000 |
| Subject: | note 110154 deleted from mysqli.multi-query by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190999@lists.php.net to get a copy of this message | ||
Note Submitter: jlong at carouselchecks dot com
----
Getting "Error: Commands out of sync; you can't run this command now" after running a
multi-query? Make sure you've cleared out the queue of results.
Here's what I've used to discard all subsequent results from a multi-query:
<?php
while($dbLink->more_results() && $dbLink->next_result()) {
$extraResult = $dbLink->use_result();
if($extraResult instanceof mysqli_result){
$extraResult->free();
}
}
?>