title: Invalid cursor state, SQL state 24000 in SQLExecDirect
body: <p>I need to call two stored procedures in sequence via ODBC in PHP:</p>
  
  <pre><code>#run stored procedure 1
  $query = "Shipped_Not_Shipped_Rep ".$_GET['rep_id'];
  $result = odbc_exec($dbh, $query);
  odbc_result_all($result);
  
  #run stored procedure 2
  $query = "Shipped_Not_Shipped_Account ".$_GET['account_id'];
  $result = odbc_exec($dbh, $query);
  odbc_result_all($result);
  </code></pre>
  
  <p>I'm getting this error in PHP after the second stored procedure call:</p>
  
  <blockquote>
    <p>Warning: odbc_exec() [function.odbc-exec]: SQL error:
    [unixODBC][FreeTDS][SQL Server]Invalid
    cursor state, SQL state 24000 in
    SQLExecDirect</p>
  </blockquote>
  
  <p>If I re-arrange the order I call the stored procedures, it is always the second that errors.  Is there a way to, idk, reset the cursor position between calls?  A little out of my element here.</p>