• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quotes in Query Builder - Codeigniter 3.0.0

#1
Hello

I just updated a project to Codeigniter 3.0.0. It is an unusual project since the combination is PHP / MSSQL Database. There were some errors in Codeigniter 2.1.4 regarding the sqlsrv driver which are no fixed.

However, there seems to be a new problem for me: The new Query Builder sets quotes around the table name. What works fine in most cases, but it doesn't seem the check if it is a table name after all! So if I use some special queries, they get broken.

For example:

$this->db->where('NOT EXISTS .....

becomes

AND "NOT" EXISTS ...


$this->db->join('table_1', 'CAST(...

becomes

LEFT JOIN "table_1" ON "CAST"(...


So the first word in the queries gets some quotes which ruins the query. Am I the only one with this problem? Seems like a big issue for me? Any Solutions? Thank you.

Greetings
Marc
Reply

#2
You can turn off auto escape as in the docs
http://www.codeigniter.com/user_guide/da...der::where
http://www.codeigniter.com/user_guide/da...lder::join
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.