CodeIgniter Forums
variable type and $this->db->count_all_results(); - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: variable type and $this->db->count_all_results(); (/thread-10100.html)



variable type and $this->db->count_all_results(); - El Forum - 07-18-2008

[eluser]Eric Cope[/eluser]
Maybe its just my C background, but shouldn't the function
Code:
$this->db->count_all_results();
return an integer, not a string? I currently typecast it, but this seems like something that should be done within the db class. Was there a reason for it to return a string?


variable type and $this->db->count_all_results(); - El Forum - 07-20-2008

[eluser]thinkigniter[/eluser]
I use this feature, mostly, to display the results of a search but if I use it in a checking how many results and I need it as a Integer I use the php function intval();

Does this help?