![]() |
has query escaping problem been fixed in 1.7? - 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: has query escaping problem been fixed in 1.7? (/showthread.php?tid=14592) |
has query escaping problem been fixed in 1.7? - El Forum - 01-08-2009 [eluser]a_z_[/eluser] Hello all, Like some other people that have posted, I upgraded to v1.7 and many of my queries are now broken because CI is being a bit overzealous in escaping things with backticks. I know that I can turn this off in some of the Active Record functions by passing FALSE as a second or third parameter. But my application is large and has many queries spread across many models. So addressing this on a query by query basis is not very practical for me. Has this problem been fixed? Or alternatively, is there a way to turn off this type of escaping globally? I think CI is a fantastic framework and I'm eager to get things running smoothly like they were under v.1.6.3 thanks, az has query escaping problem been fixed in 1.7? - El Forum - 01-08-2009 [eluser]Phil Sturgeon[/eluser] This is not a problem, its a new feature and standard way of working in 1.7, so I'm sorry to say it wont be changed back. The only two options available are update your AR calls, or stay with 1.6.3. ![]() has query escaping problem been fixed in 1.7? - El Forum - 01-09-2009 [eluser]Bogdan Tanase[/eluser] Hmm... if I remember correctly CI 1.7 escapes stuff that shouldn't normally escape, like some SQL keywords, * symbol; I don't think this is "standard", or at least it shouldn't be... has query escaping problem been fixed in 1.7? - El Forum - 01-09-2009 [eluser]Phil Sturgeon[/eluser] Well the AR is not meant as a standard SQL implementation, it is a new way of doing things based on SQL. Mixing AR and pure SQL will always cause you issues, more-so now that in the past as the dev team get stricter on what is allowed in the AR functions. It makes sense really. If you want to do a simple query, use AR. If you want sub-queries, unions, boolen searches, etc, use pure SQL with query(). has query escaping problem been fixed in 1.7? - El Forum - 01-09-2009 [eluser]a_z_[/eluser] Hi guys, Thanks for the responses. pyromaniac, I see what you are saying, but just so we're clear, I'm not talking about very sophisticated queries here. E.g.: $this->db->select('count(results.idnum) as totalresults'); This works great in CI 1.6.3, but under 1.7 it chokes unless I add FALSE as a second parameter. I agree that Active Record may not be appropriate for complex queries, but I currently have a large number of pretty simple queries that work fine under 1.6.3, and it's a shame that they won't work under 1.7. I think Active Record is a great way to put database calls together and I'm concerned that this new feature makes it significantly less useful. thanks, az |