title: CODEIGNITER Exception: Call to a member function num_rows() on boolean
body: <p>Please I have an issue with codeigniter. when I try to log here is the result:</p>
  <p>Severity: error --&gt; Exception: Call to a member function num_rows() on boolean /home/euroyals/bdhospitals.com/amar-pharmacy/application/models/Reports.php 276</p>
  <p>Below the code of the relative file:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>public function out_of_stock_count(){
  
      
    $this-&gt;db-&gt;select("b.manufacturer_name,a.product_name,a.generic_name,a.strength,((select ifnull(sum(quantity),0) from product_purchase_details where product_id= `a`.`product_id`)-(select ifnull(sum(quantity),0) from invoice_details where product_id= `a`.`product_id`)) as 'stock'");
         $this-&gt;db-&gt;from('product_information a');
         $this-&gt;db-&gt;join('manufacturer_information b','b.manufacturer_id=a.manufacturer_id','left');
           $this-&gt;db-&gt;having('stock &lt; 10');
           $this-&gt;db-&gt;group_by('a.product_id');
           return $records = $this-&gt;db-&gt;get()-&gt;num_rows();</code></pre>
  </div>
  </div>
  </p>