Codeigniter select as

how do we do    select table.value as table_value from tablein codeigniter?
The part ASdoes not work, because when I try to access the value, it does not work:

    $qry_inp =  'select table.value as table_value from table '
    $query = $this->db->query($qry_inp); 

    echo $query->row('table_value ');// this will be empty, but it shouldn`t be

doesn't matter if its in AR or a simple query

+3
source share
3 answers

Where is this behavior documented? rowdoes not accept the column name as a parameter; he does not necessarily accept the line number and that he is. Access to it, as in any other field:

echo $query->row()->table_value;
+4
source

Pretty simple thing.

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

, , , AS codeigniter

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

All Articles