CodeIgniter Forums
Issue with get_where and where methods in query builder. - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Issue with get_where and where methods in query builder. (/showthread.php?tid=69912)



Issue with get_where and where methods in query builder. - skunkbad - 01-29-2018

I just "answered" a Stack Overflow question that seems to point out a bug in get_where and where methods in the query builder:

https://stackoverflow.com/questions/48507219

This is using the current version of CodeIgniter, 3.1.7.

Basically, if a string is used as the where condition that contains " and x between x and ", then the query builder is inserting a bunch of backticks.

The query bindings feature doesn't have this problem.

I don't have a good enough understanding of the DB classes to help fix this, or know if it can be fixed.


RE: Issue with get_where and where methods in query builder. - Narf - 01-30-2018

That's what happens when we try to make everybody happy ...

https://github.com/bcit-ci/CodeIgniter/commit/7dd6f14073c109a3227d78e30780ab79117bda42

I'm hoping this is the 1% case where a fix to the QB doesn't cause another bug. Smile


RE: Issue with get_where and where methods in query builder. - skunkbad - 01-30-2018

(01-30-2018, 06:17 AM)Narf Wrote: That's what happens when we try to make everybody happy ...

https://github.com/bcit-ci/CodeIgniter/commit/7dd6f14073c109a3227d78e30780ab79117bda42

I'm hoping this is the 1% case where a fix to the QB doesn't cause another bug. Smile

I was a little worried about that. Seems like it would be super rare that somebody would build up a query like that. Fingers crossed!


RE: Issue with get_where and where methods in query builder. - Narf - 04-13-2018

Hope died pretty quickly on this one: https://github.com/bcit-ci/CodeIgniter/issues/5448