CodeIgniter Forums
Select with string type alias - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Select with string type alias (/thread-74962.html)



Select with string type alias - luden - 12-01-2019

Hi,

I try to query with alias a string but it does not work: 

$query=$this->db->query('SELECT id_observation as "1" FROM Observation ');

return $query->result();


but this work well with letters :

$query=$this->db->query('SELECT id_observation as "testcolumname" FROM Observation ');

return $query->result();

I did a print_r($this->db->last_query()); and the result works well directly on phpmyadmin but not within the codeigniter framework
I tried to change some settings to the database configuration but it is still the same problem