Get single row selected column in php
How do you get a single row selected column from the Codeigniter query?
Query:
$query = $this->db->select('column_name as cn ')->from('table_naem')->where('id', 'your_id')->get()->row()->cn; Answer : column_name
Explanation:
- cn(object) used to get column value.
- if we add query before $ we have to see This answer in log
Tagged: