[eluser]Trippo[/eluser]
[quote author="etilico" date="1243619568"]Hi everybody!
I've produced a query using active record with a select statement like this:
Code:
$this->db->select("pm.*, pmo2.entity_id as owner_id, pmo2.type as owner_type, CONCAT(u.name, ' ', u.surname ) as owner_name, ids.entity as owner_entity")
but after the get call the query produced has a select statement like these one:
Code:
SELECT `pm`.*, `pmo2`.`entity_id` as owner_id, `pmo2`.`type` as owner_type, CONCAT(u.name, `'` ', `u`.`surname` ) as owner_name, `ids`.`entity` as owner_entity
the space char in the CONCAT is not correctly escaped and generates an execution error...
[/quote]
I find the solution....
It's simple, you place as second parameter of select function FALSE:
Code:
$this->db->select("pm.*, pmo2.entity_id as owner_id, pmo2.type as owner_type, CONCAT(u.name, ' ', u.surname ) as owner_name, ids.entity as owner_entity",FALSE)