jigniter™

jQuery & CodeIgniter – Perfect combination for web application

Get a single table field value from database using CodeIgniter

no comments

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.

Related posts:

  1. Import CSV file into database using CodeIgniter
  2. Using url_title() with Spanish or other strange characters

Posted by admin

2009-08-30 at 10:23 am

Leave a Reply