Welcome Guest, Not a member yet? Register   Sign In
Using where() and or_like() in the same query
#1

[eluser]simonmaddox[/eluser]
I'm working on our search model at the moment, and found that I need to do a where() Active Record call, which needs to be surrounded by brackets, then an or_like() call outside of the brackets.

The brackets are key to the query - without them, it doesn't work. Any ideas how I can force $this->db->where() to encapsulate it's contents in them without writing the query manually?

(Btw, brackets = parentheses)
#2

[eluser]majidmx[/eluser]
I'd say writing the query manually will be easier in this case.
If you need a hand on writing the query you can explain it more and get it done.
#3

[eluser]TheFuzzy0ne[/eluser]
Yes, you can specify FALSE as the third parameter to prevent escaping of the query, and enter whatever you like for the WHERE statement.

Example:
Code:
$this->db->where("COUNT(DISTINCT col) > 5", NULL, FALSE);

Hope this helps.




Theme © iAndrew 2016 - Forum software by © MyBB