title: Codeigniter DB errors after stored procedure call
body: <p>I have a database that has a few stored procedures in it that I would like to call via CodeIgniter.  I have the following code in my Model class:</p>
  
  <pre><code>$sql = "CALL `stored_proc`(1)";
  $query = $this-&gt;db-&gt;query($sql); //This call breaks the DB :(
  
  $this-&gt;db-&gt;select('status');
  $this-&gt;db-&gt;where('id', $id);
  $query = $this-&gt;db-&gt;get('table');
  
  print($query-&gt;num_rows()); //line 1116
  </code></pre>
  
  <p>When I run this code, I get the following error:</p>
  
  <blockquote>
    <p>Fatal error: Call to a member function num_rows() on a non-object in C:\server\apache\htdocs\application\models\let_model.php on line 1116</p>
  </blockquote>
  
  <p>If I remove the query line, the select works properly.  Also, if I replace the call to a stored procedure with say a SELECT command, it also works properly.</p>
  
  <p>Is there something obvious I'm missing for why I'm getting this error?  If there isn't a good answer, is there a way to work around this problem?</p>
  
  <p>Thanks for your time!</p>
  
  <p><strong>Edit:</strong> After delving a little deeper into the problem, it seems that this error will occur if my stored procedure contains a SELECT command.  UPDATES seem to work properly.  Perhaps this problem has something to do with how CodeIgniter deals with SELECT results?</p>