Codeigniter- $this->db->like is case sensitive

There is no case insensitive version of the like function. What you can do is transform both sides of the comparison to lower case, so that you take that out of the equation.

$this->db->like('LOWER(' .$field. ')', strtolower($value));


$this->db->like('LOWER(field_name)', strtolower($value));

Leave a Reply

Your email address will not be published. Required fields are marked *