I have a question. I have a function in a model to select products:
public function getProducts()
{
$this->db->select(dbColumnProductsId . ',' . dbColumnProductsName . ',' . dbColumnProductsImage . ',' . dbColumnProductsPrice . ',' . dbColumnProductsStock . ',' . dbColumnCategoryId . ',' . dbColumnCategoryName);
$this->db->join(dbTableCategory, dbTableCategory . '.' . dbColumnCategoryId . '=' . dbTableProducts . '.' . dbColumnProductsCategory);
$this->db->order_by(dbColumnProductsId, 'DESC');
$this->db->from(dbTableProducts);
$query = $this->db->get();
if($query->num_rows() > 0)
{
return $query->result_array();
}
return FALSE;
}
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