Welcome Guest, Not a member yet? Register   Sign In
Active record and naming a column
#1

[eluser]frist44[/eluser]
Using $this->db->select, is there a way to say 'SELECT column as name' ?

I'm having to revert to writing the whole query by hand and then just doing $query = $this->db->query($sql, array($u, $pw));

Thanks.
#2

[eluser]jedd[/eluser]
[quote author="frist44" date="1262039380"]
Using $this->db->select, is there a way to say 'SELECT column as name' ?
[/quote]

If you read the SQL FAQ in the wiki - [url="http://codeigniter.com/wiki/SQL"]http://codeigniter.com/wiki/SQL[/url] - you'll find a few hints in there.
#3

[eluser]frist44[/eluser]
perfect. Thanks!
#4

[eluser]Johan André[/eluser]
Code:
$this->db->select('column_name AS column_alias');




Theme © iAndrew 2016 - Forum software by © MyBB