[eluser]Cristiano Bianchi[/eluser]
In CI 1.6.1.
When sending a rather complex query using active record, if in a part of the $this->db->select statement there are IF functions, like:
Code:
if(c.typeid = 104, c.custom0, null) AS address,
if(c.typeid = 104, c.custom1, null) AS telephone,
if(c.typeid = 104, c.custom2, null) as email,
erratically, the query is converted to something like:
Code:
if(c.typeid = 104, c.custom0, null) AS address, c.custom1, null) AS telephone, c.custom2, null) as email
The second and third IFs are deleted and melted, resulting in an error. I have turned the auto escaping to false, but that still does not help.
It all works fine in CI 1.5.1.
What is it happening with the query?
Thanks, Cristiano