title: num_rows() and result_array() in the same function ? codeigniter
body: <p>I have a question.
  I have a function in a model to select products:</p>
  
  <pre><code>public function getProducts()
  {
      $this-&gt;db-&gt;select(dbColumnProductsId . ',' . dbColumnProductsName . ',' . dbColumnProductsImage . ',' . dbColumnProductsPrice . ',' . dbColumnProductsStock . ',' . dbColumnCategoryId . ',' . dbColumnCategoryName);
      $this-&gt;db-&gt;join(dbTableCategory, dbTableCategory . '.' . dbColumnCategoryId . '=' . dbTableProducts . '.' . dbColumnProductsCategory);
      $this-&gt;db-&gt;order_by(dbColumnProductsId, 'DESC');
      $this-&gt;db-&gt;from(dbTableProducts);
      $query = $this-&gt;db-&gt;get();
  
      if($query-&gt;num_rows() &gt; 0)
      {
          return $query-&gt;result_array();
      }
  
      return FALSE;
  }
  </code></pre>
  
  <p>But now I need to make a pagination of these products. How did I can use the "num_rows" function in the same function? This way there would have to create a separate function. Sorry for my poor english</p>