[eluser]Davcon[/eluser]
Hi,
On the CI user guide we are told that the way to count the number of results generated by a query is:
$this->db->count_all_results();
However, I've noticed lately that the (count) results I've been getting back from those queries aren't accurate. I've also noticed that some people are using:
$query->num_rows();
...to find out the number of rows generated by a query.
Interestingly the $query->num_rows() method does not appear to be mentioned on the active record part of the user guide. However, it does produce accurate results.
So, this is really a request for clarification. I have a bunch of questions:
1. Have I misunderstood what the purpose of db->count->all_results() is?
2. What is the "proper" method of counting rows of results using Active Record?
3. How come the num->rows() method doesn't appear to get a mention in the user guide?
Thank you so much.