Welcome Guest, Not a member yet? Register   Sign In
Strange output from select in Active records
#1

[eluser]mlinuxgada[/eluser]
Hi,
I have strange behaviour using active records:
Code:
$this->db->distinct();
$this->db->select('date_format(date, \'%Y-%m\') as date_format');
....
It produces the following sql query:
Code:
SELECT DISTINCT date_format(date, `'%Y-%m')` as date_format FROM ...
Where is my mistake ... or it's a bug?
#2

[eluser]WanWizard[/eluser]
This is described in the manual.

The AR functions by default tries to escape all fields. This doesn't work on SQL functions, so you have to disable automatic escaping.
#3

[eluser]mlinuxgada[/eluser]
Thanks!




Theme © iAndrew 2016 - Forum software by © MyBB