codeigniter count database load on page code example
Example: codeigniter count rows
$this->db
->where(['field'=>'foo'])
->from("tablename")
->count_all_results();
//OR
$this->db
->where(['field'=>'foo'])
->count_all_results("tablename");