I am using CI3 and i have a search page. In my search page, I have a option called LIKE. I used % value before my search string, like, %dd11, which is become something like this
WHERE t.name LIKE '�11'
I have added in the header and i also set up my charset in database config.
here is my form input field
and here is my php code
if (preg_match('/(LIKE).*/', $field)) {
$field = preg_replace('/\s(LIKE)/', '', $field);
$field = $field.' LIKE';
if (preg_match("/\./", $field)) {
$where .= $field." '".$value.";
} else {
$where .= "t.".$field." '".$value.";
}
}
can anyone tell me why its become encoded like this. please help me