[eluser]webnology[/eluser]
Hi all,
I'm having this model to search the db for a specific search_term. If I only search in the firstname column, it works fine, If I add or_like for the lastname column, my other where statement seem to be ignored.
Can anyone help me out here, please?
Code:
function getAllCustomersLikeSearchTerm($search_term, $user_id)
{
$this->db->select('*');
$this->db->from('customers');
$this->db->like('firstname', $search_term, 'both');
$this->db->or_like('lastname', $search_term, 'both');
$this->db->order_by('firstname', 'asc');
$this->db->where('user_id', $user_id);
$this->db->where('flag_sleep', '0', FALSE);
$Q = $this->db->get();
return $Q;
}
Kind regards,
Michel