title: Codeigniter Call to a member function num_rows() on a non-object
body: <p>Function in model file:</p>
  
  <pre><code>function get_user_by_email($email)
  {
      //$this-&gt;consumer-&gt;where('email=', strtolower($email));
      //$query = $this-&gt;consumer-&gt;get($this-&gt;table_name); 
  
      $query = $this-&gt;db-&gt;query('CALL get_user_by_email("'.strtolower($email).'")');
      echo $query-&gt;num_rows();
  }
  </code></pre>
  
  <p>This function returns error <code>Call to a member function num_rows() on a non-object in</code> whereas the other functions in the same file returns the row count. Also tried the active record query. But the query also returns the same error.</p>
  
  <p>I tried using <code>result(), result_array()</code> also. But everything gives me error.</p>
  
  <p>Thanks</p>