Welcome Guest, Not a member yet? Register   Sign In
or_like problem
#3

[eluser]mah0001[/eluser]
I don't think you can combine the AND and OR the way you want using the Active Record. The alternate is:
Code:
$sql = "SELECT * FROM {$this->db->dbprefix}customers WHERE user_id = ? AND flag_sleep=? AND (firstname like ? OR lastname like ?) order by firstname asc";
$Q=$this->db->query($sql, array($user_id,0, '%'.$search_term.'%', '%'.$search_term.'%'));
return $Q;


Messages In This Thread
or_like problem - by El Forum - 11-06-2009, 05:43 AM
or_like problem - by El Forum - 11-06-2009, 03:04 PM
or_like problem - by El Forum - 11-06-2009, 04:32 PM
or_like problem - by El Forum - 11-06-2009, 04:35 PM
or_like problem - by El Forum - 11-06-2009, 04:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB