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

[eluser]Burak Guzel[/eluser]
If there is no simpler way of doing it, maybe this could work too:

Code:
function getAllCustomersLikeSearchTerm($search_term, $user_id)
    {
        $this->db->select('*');
        $this->db->from('customers');
        
        $this->db->like('firstname', $search_term, 'both');
        $this->db->where('user_id', $user_id);
        $this->db->where('flag_sleep', '0', FALSE);
        
        $this->db->or_like('lastname', $search_term, 'both');
        $this->db->where('user_id', $user_id);
        $this->db->where('flag_sleep', '0', FALSE);
        
        $this->db->order_by('firstname', 'asc');

        $Q = $this->db->get();
        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