CI 1.7 - Error on querys (quotes escaping problems) |
[eluser]Nom4d3[/eluser]
I always used my querys like this: Code: $this->db->where('O.dope_login', $login); I never had any problems. But with 1.7, i got this error: Code: A Database Error Occurred im doing something wrong or this is a new bug? I have a lot of querys with the same problem now :/
[eluser]nico060475[/eluser]
Hi there, I've just replaced 1.6.3 by 1.7.0 and I also have some queries that stopped working. In my case the quotes used to escape the field names are not set correctly. for example i have Code: $this->db->select("IFNULL(foo,bar)")->get('table'); SELECT IFNULL(`foo`,`bar)` FROM table;
[eluser]AgentPhoenix[/eluser]
I guess I'll tack on to this one. I'm having issues with the MySQL driver using the Database Forge. When I try to add a primary key, things go downhill. Here is what I'm doing in my controller: Code: $this->dbforge->add_field('role_id'); Everything looks fine until you get to the end where it tries to do the primary key. CI outputs this when I try to run the code: Code: (...) PRIMARY KEY `role_id` () When I take the query, pule role_id inside the parenthesis, and run it in phpMyAdmin, it works fine. Any ideas? Update - I did some digging and it turns out that I'm feeding the Forge an array of things and the 1.7 version of _protect_identifiers doesn't account for $item being an array whereas the 1.6.3 version did, hence why things are breaking and it's throwing errors about "Array to string conversion".
[eluser]thespy[/eluser]
I also have a problem after upgrading from 1.6.3 to 1.7 : I'm using Mysqli. In some models I have: Code: $this->db->select('onetable.*, othertable.name as other_name'); It was working perfectly, but now the query is not handled correctly. Quote:Query error: Unknown column 'onetable.*' in 'field list'
[eluser]Derek Allard[/eluser]
Could those of you having issues with select() try adding the parameter to prevent escaping? IE: Code: $this->db->select('onetable.*, othertable.name as other_name', FALSE); I'm not sure if this is the issue, in fact I don't think it is, but want to eliminate this quickly.
[eluser]skattabrain[/eluser]
you can add miner to list ... i have a deadline so i'm reverting to 1.6.3 for now. http://ellislab.com/forums/viewthread/94824/ I'm cutting and pasting my issue here, sorry for duplication ... So this used to work on 1.6.3, it should do the following ... get from the table 'entries' that have 'active' = 1 that also have either 1 of the 2 items ... entries.user_id = '.$this->session->userdata('user_id') OR entries.public = "1" Code: $this->db->from('entries'); this is the code it creates ... Code: SELECT * FROM (`entries`) this is what it should create ... Code: SELECT * FROM (`entries`) also this ... i use active record but probably do things it wasn't intended too ... this also no longer works ... Code: $this->db->select('ingredient_item.ingredient_id, what it creates ... Code: SELECT `ingredient_item`.`ingredient_id`, `ingredient_to_product`.`ingredient_id` as liveing_id, `ingredient_item`.`ingredient` as name, `ingredient_type`.`ingredient_type`, `ingredient_to_product`.`product_id`
[eluser]nico060475[/eluser]
Hi Derek, The query works again if I set the 2nd parameter in select() and the 3rd paramter in where() to FALSE.
[eluser]thespy[/eluser]
An other related topic about this problem I think: http://ellislab.com/forums/viewthread/94775/
[eluser]hotmeteor[/eluser]
[quote author="Derek Allard" date="1224877579"]Could those of you having issues with select() try adding the parameter to prevent escaping? IE: Code: $this->db->select('onetable.*, othertable.name as other_name', FALSE); I'm not sure if this is the issue, in fact I don't think it is, but want to eliminate this quickly.[/quote] I too was having SELECT issues, and this fixed it. [quote author="Rick Ellis" date="1224883077"]We'll try to get all these resolved today.[/quote] Thanks Rick, Derek, and team. CI is super. |
Welcome Guest, Not a member yet? Register Sign In |