Welcome Guest, Not a member yet? Register   Sign In
where() and like() are not working together
#3

[eluser]Nartub[/eluser]
Ahh I've found the problem. Thing is like this:

Code:
$this->db->where('column1', 'match1');

$this->db->like('column2', 'match2');
$this->db->or_like('column3', 'match2');
$this->db->or_like('column4', 'match2');

So the query is:

Code:
...WHERE column1 = match1 AND column2 LIKE match2 OR column3 LIKE match2 OR column4 LIKE match2

But it should be:

Code:
...WHERE column1 = match1 AND (column2 LIKE match2 OR column3 LIKE match2 OR column4 LIKE match2)

Is there any way to do this?

Thanks!


Messages In This Thread
where() and like() are not working together - by El Forum - 03-22-2012, 05:40 PM
where() and like() are not working together - by El Forum - 03-22-2012, 06:56 PM
where() and like() are not working together - by El Forum - 03-22-2012, 07:50 PM
where() and like() are not working together - by El Forum - 03-22-2012, 07:52 PM
where() and like() are not working together - by El Forum - 03-22-2012, 07:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB