I\'m working with the latest codeIgniter
released, and i\'m also working with jquery
datatables
from datatables.net
I
$this->db->count_all_results()
replaces $this->db->get()
in a database call.
I.E. you can call either count_all_results()
or get()
, but not both.
You need to do two seperate active record calls. One to assign the results #, and one to get the actual results.
Something like this for the count:
$this->db->select('id');
$this->db->from('table');
$this->db->where($your_conditions);
$num_results = $this->db->count_all_results();
And for the actual query (which you should already have):
$this->db->select($your_columns);
$this->db->from('table');
$this->db->where($your_conditions);
$this->db->limit($limit);
$query = $this->db->get();