CodeIgniter Forums
CI 1.7 - Error on querys (quotes escaping problems) - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI 1.7 - Error on querys (quotes escaping problems) (/showthread.php?tid=12582)

Pages: 1 2 3 4 5


CI 1.7 - Error on querys (quotes escaping problems) - El Forum - 08-20-2010

[eluser]Kumar Chetan sharma[/eluser]
The issue is still there with CI 1.7.2. I am supposed to upgrade a portal to CI1.7.2 and it seems that problem is still there. I removed the backtick in active record class and I hate myself for tinkering with 3rd party libs/code in my project. It is like adding bugs. I will file a bug.


CI 1.7 - Error on querys (quotes escaping problems) - El Forum - 11-08-2010

[eluser]Krynble[/eluser]
Just another heads up, I updated to version 1.7.2 and the problem I had remains.

Sample code:

Code:
$this->db->select("p.id_premio, p.ano, pr.nome as premiacao, IFNULL(c.nome , 'Tesis') as cliente, p.projeto, a.nome as agencia, t.arquivo, p.colocacao")

Generated Query:

Code:
SELECT `p`.`id_premio`, `p`.`ano`, `pr`.`nome` as premiacao, IFNULL(c.nome, `'Tesis')` as cliente, `p`.`projeto`, `a`.`nome` as agencia, `t`.`arquivo`, `p`.`colocacao`

The IFNULL function parameter was escaped, while it shouldn't.

I haven't checked for a solution, just trying to complement the information related to the problem. Again, using false as the second parameter for the select caused the select statement to be left unscaped and solved the problem, but I don't really like this idea either.

Thanks in advance,
Omar Ajoue.