![]() |
[2.1.1] Active Record quotes marks issues - 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: [2.1.1] Active Record quotes marks issues (/showthread.php?tid=52493) Pages:
1
2
|
[2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]Nom4d3[/eluser] I tried a lot of ways and I couldn't find a way to make my 'WHERE' clauses work properly. My testing code: Code: $this->db->select("table1.*") Result: Code: SELECT "table1".* in 2.1.0 the result was Code: SELECT "table1".* The first 'where' is the one which I've been using since I began to work with CI. I don't really want to set FALSE for escape parameter for EVERY single 'where' clause I have. Am I doing something wrong? Tested only on Postgres. [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]Nom4d3[/eluser] It seems it's related to these bugs: https://github.com/EllisLab/CodeIgniter/issues/1469 https://github.com/EllisLab/CodeIgniter/issues/1471 [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]InsiteFX[/eluser] Code: ->where("table1.t1_id = table2.t1_id") [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]Nom4d3[/eluser] My 3th example of where clause is something like that and is not working also. The only difference is in my example I'm using != and not = [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]Costa Rica SEO[/eluser] Same here: Code: $custom_where = "`menu_item` > 0 AND `subdomain` = '{$this->subdomain}' OR `menu_item` = 1 AND `subdomain` = ''"; Results in: Code: SELECT `menu_name`, `url`, `security`, `menu_item`, `ssl_required`, `menu_class`, `title` Notice that both the WHERE and ORDER BY are both broken. [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]WanWizard[/eluser] I've posted a suggested fix: https://github.com/EllisLab/CodeIgniter/issues/1469 which has fixed this issue for Datamapper. Basically all components of a query which contain 2 spaces (i.e. something more then "string string" or ""string AS string") are incorrectly quoted by the DB_driver. [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]bcorcoran[/eluser] Would like to chime in that I, too, have issue with this update in 2.1.1. Edit: BTW, the "fix" for 2.1.1 basically causes the ar_no_escape argument to be worthless, as it escapes the stuff anyway. [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]CroNiX[/eluser] Hard to believe something this big wasn't discovered during some sort of testing. [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]skunkbad[/eluser] Maybe there will be a quick v2.1.2 [2.1.1] Active Record quotes marks issues - El Forum - 06-13-2012 [eluser]Corey Wynsma[/eluser] Same here... even something simple like Code: $this->db->where('field <', 25); |