jigniter™

jQuery & CodeIgniter – Perfect combination for web application

Get a single table field value from database using CodeIgniter

sin comentarios

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.

Escrito por admin

2009-08-30 at 10:23 am

Publicado en Uncategorized

Leave a Reply