Welcome Guest, Not a member yet? Register   Sign In
Multiple Keyword Search
#1

[eluser]georgerobbo[/eluser]
Hello.

I have the following query which selects a profile from the database based on keyword/s. However, the problem I am having is if you search for either a first name or surname of a user the database returns relevant results. However if you use both the first name and surname in the query the database returns zero results.

How can I adjust my model so?

Code:
function search($keyword)
    {
        $this->db->select('*');
        $this->db->from('member');
        $this->db->like('ID', $keyword);
        $this->db->or_like('Firstname', $keyword);
        $this->db->or_like('Surname', $keyword);
        $this->db->group_by('ID');
        
        $query = $this->db->get();
        return $query->result_array();
    }


Messages In This Thread
Multiple Keyword Search - by El Forum - 11-03-2009, 02:34 PM
Multiple Keyword Search - by El Forum - 11-03-2009, 02:49 PM
Multiple Keyword Search - by El Forum - 11-03-2009, 02:54 PM
Multiple Keyword Search - by El Forum - 11-03-2009, 04:12 PM
Multiple Keyword Search - by El Forum - 06-06-2014, 08:55 AM
Multiple Keyword Search - by El Forum - 06-08-2014, 02:05 PM
Multiple Keyword Search - by El Forum - 06-09-2014, 01:31 AM



Theme © iAndrew 2016 - Forum software by © MyBB