title: 2nd call to stored procedure gives error (2014)
body: <p>my 1st day with stored procedures.
  when i call the procedure for the 2nd time i get an error?</p>
  
  <p>it seems it has something to do with the way i fetch the result and i have to free the result?
  I have tried different ways, but i can't get it error-free:( </p>
  
  <pre><code>$t = 27;
  $res = $mysqli-&gt;query("CALL ts_open_uitdagingen('".$t."')");
  $aRes = $res-&gt;fetch_assoc();
  echo '&lt;br /&gt;'.$aRes['open_uitdagingen'].'&lt;br /&gt;';
  echo'&lt;hr /&gt;';
  
  $t = 80;
  $res = $mysqli-&gt;query("CALL ts_open_uitdagingen('".$t."')");
  echo "&lt;br /&gt;CALL failed?: (" . $mysqli-&gt;errno . ") " . $mysqli-&gt;error;
  $aRes = $res-&gt;fetch_assoc();
  echo 'bBr /&gt;'.$aRes['open_uitdagingen'].'&lt;br /&gt;';
  echo'&lt;hr /&gt;';
  </code></pre>
  
  <p>Displays:</p>
  
  <p>1</p>
  
  <p>CALL failed?: (2014) Commands out of sync; you can't run this command now Fatal error: Call to a member function fetch_assoc() on a non-object in /home/xxxxxxxxxx.nl/public_html/content/speler_uitdagen.php on line 14 </p>