Welcome Guest, Not a member yet? Register   Sign In
Using Mysql function names in the active record set select method
#1

[eluser]vigna[/eluser]
Hi,
I am using active recordset object.
when I pass a mysql function name in the select method call, it returns an error.

Code:
$this->db->select('field1, field2, date_format(date_field_name, "%D/%M/%Y %H:%M") as some_date');

When I checked the query, I can see that the quotes (`) applied for the field names by CI creates problem.

Is there any way to get around this.

Thanks
#2

[eluser]mackerel[/eluser]
select() takes a second argument. If it's FALSE, codeigniter won't quote the select.
#3

[eluser]vigna[/eluser]
Thanks mackerel!




Theme © iAndrew 2016 - Forum software by © MyBB