[eluser]Michael Wales[/eluser]
Quote:f you execute the sql immediately after the query you should be able to return the total number of found rows even while a limit/offset is present
Why would you issue another request to the database server and wait for a response when mysql_num_rows() does the same thing? or num_rows() within CodeIgniter's ActiveRecord library.
To the OP:
Code:
function get_all() {
$this->db->select('title, filename, COUNT(*) AS total', FALSE);
$query = $this->db->get('files');
if ($query->num_rows() > 0) {
return $result;
}
return FALSE;
Code:
$files = $this->model->get_all();
echo $files->total;