CodeIgniter Forums

Full Version: SQL_CALC_FOUND_ROWS. Where I can place the follow code ?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Code:
// This function run after query with SQL_CALC_FOUND_ROWS instruction    
function found_rows()
{
    $query = $this->query('SELECT FOUND_ROWS() AS fr');
    $row = $query->row();
        return $row->fr;
}


//.....

$this->db->found_rows();

El Forum

[eluser]Sam Dark[/eluser]
Into base model MY_Model.

El Forum

[eluser]Unknown[/eluser]
If i use base model(MY_Model) i was write:
Code:
$this->myUserGidModelName->found_rows()
but i want write
Code:
$this->db->found_rows();
because in my opinion it's logically