Get a single table field value from database using CodeIgniter
If you want to get a single value from a database table, then an easy way to achieve that in CodeIgniter could be:
$count = $this->db->query('SELECT count(*) as count FROM departments')->row()->count;
Replace department by your table name, and of course, replace count(*) as count by your desired field.



