El Forum
10-19-2008, 02:59 PM
[eluser]Zac G.[/eluser]
Hi folks,
I am working with this method:
If I type in a name exactly how it appears in the database it returns the results, however, if I type a name in that is not exactly how it is written it returns does not usually return any results.
Am I making a mistake with somewhere with the code, or am I just not understanding the limitations of of MySQL like?
For example,
Name in database: "Sarah" I type "Sara" and get a result.
Another name in database: "Zac" and type "Zak" I get nothing.
Am I doing something wrong wrong, or is there a way that I can strengthen the power of the like search?
Thanks!
Zac
Hi folks,
I am working with this method:
Code:
$this->db->like('first_name', $keywords);
$this->db->or_like('last_name', $keywords);
$this->db->join('member_groups', 'member_groups.id = users.member_group');
$query = $this->db->get('users');
return $query;
If I type in a name exactly how it appears in the database it returns the results, however, if I type a name in that is not exactly how it is written it returns does not usually return any results.
Am I making a mistake with somewhere with the code, or am I just not understanding the limitations of of MySQL like?
For example,
Name in database: "Sarah" I type "Sara" and get a result.
Another name in database: "Zac" and type "Zak" I get nothing.
Am I doing something wrong wrong, or is there a way that I can strengthen the power of the like search?
Thanks!
Zac