• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Query with like and or_like not returning like results

#1
[eluser]Zac G.[/eluser]
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


Messages In This Thread
Query with like and or_like not returning like results - by El Forum - 10-19-2008, 02:59 PM
Query with like and or_like not returning like results - by El Forum - 10-19-2008, 03:10 PM
Query with like and or_like not returning like results - by El Forum - 10-19-2008, 03:42 PM
Query with like and or_like not returning like results - by El Forum - 10-19-2008, 03:47 PM
Query with like and or_like not returning like results - by El Forum - 10-19-2008, 05:12 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.