[eluser]Unknown[/eluser]
So, what exactly does count_all_results return? I was doing a test to try and nail it down, and I'm stumped.
I have a table called "widgets" that has 2 rows in it.
If I do this:
Code:
$this->db->cache_off(); // Just in case.
$query = $this->db->get('widgets');
print($this->db->count_all_results());
print($query->num_rows());
print_r($query->result());
...I get that count_all_results() returns "1", but num_rows() returns "2" and result() returns two objects.
What exactly is count_all_results() returning, here? Why is it one and not two?
The reason I ask is that I'm trying to paginate a search of widgets, and it seems like count_all_results() should return the value that I want to drop into the paginate class for total records, but it doesn't seem to be doing that.