The most effective method to tally question results and number of columns in table in codeigniter. On occasion you might be keen on knowing the quantity of lines in a table as opposed to bringing the actual records. Or then again to know whether your sql question really restores any records whatsoever. While you can check it utilizing select question, there are better approaches to take care of business in codeingniter.
This function counts the number of rows returned by a sql query
The count_all_results() method is another way to determine the number of rows returned by a particular Active Record query.
If you want to count just the number of rows in a database table you can use the function $this->db->count_all().