<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="commands-out-of-sync">
      </a>
      B.3.2.12 Commands out of sync
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045054234720">
  </a>
  <p>
   If you get
   <code class="literal">
    Commands out of sync; you can't run this
          command now
   </code>
   in your client code, you are calling
          client functions in the wrong order.
  </p>
  <p>
   This can happen, for example, if you are using
   <a class="ulink" href="/doc/c-api/8.4/en/mysql-use-result.html" target="_top">
    <code class="literal">
     mysql_use_result()
    </code>
   </a>
   and try to
          execute a new query before you have called
   <a class="ulink" href="/doc/c-api/8.4/en/mysql-free-result.html" target="_top">
    <code class="literal">
     mysql_free_result()
    </code>
   </a>
   . It can
          also happen if you try to execute two queries that return data
          without calling
   <a class="ulink" href="/doc/c-api/8.4/en/mysql-use-result.html" target="_top">
    <code class="literal">
     mysql_use_result()
    </code>
   </a>
   or
   <a class="ulink" href="/doc/c-api/8.4/en/mysql-store-result.html" target="_top">
    <code class="literal">
     mysql_store_result()
    </code>
   </a>
   in
          between.
  </p>
 </div>
 <br/>
</div>
