codeigniter select as codeigniter select as codeigniter codeigniter

codeigniter select as


Pretty simple thing.

$this->db->select('COLUMN_ACTUAL_NAME as `COLUMN_NAME_YOU_WANT_TO_SHOW`');


Where is that behaviour documented? row doesn't take a column name as a parameter; it optionally takes a row number, and that's it. Access it like any other field:

echo $query->row()->table_value;


i'm joining two tables in which column names are same so i separate both tables columns by using as keyword , this is how you can use AS in codeigniter

$this->db->select("departments.name AS 'dname'");$this->db->select('positions.name');