[2.1.1] Active Record quotes marks issues |
[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.
[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
[eluser]InsiteFX[/eluser]
Code: ->where("table1.t1_id = table2.t1_id")
[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 =
[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.
[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.
[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.
[eluser]CroNiX[/eluser]
Hard to believe something this big wasn't discovered during some sort of testing.
[eluser]Corey Wynsma[/eluser]
Same here... even something simple like Code: $this->db->where('field <', 25); |
Welcome Guest, Not a member yet? Register Sign In |