hello guys!
i need to perform a name search in the database based on a set of keywords. the result should be accent sensitive and case insensitive.
following the solution i found here plus few modifications to allow case insensitivity, i used the following code:
$sql = "SELECT name FROM table_names WHERE LOWER(name) LIKE _utf8 '%".strtolower($keyword)."%' COLLATE utf8_bin";
this does not work for me when the search keyword contains accents. but the strange thing is that this query works well in phpMyAdmin (but i read somewhere that this shouldn't be reliable). what could be the problem here?
UPDATE: i revised my code to:
$sql = "SELECT name FROM table_names WHERE LOWER(name) LIKE LOWER(_utf8 '%$keyword%') COLLATE utf8_bin";
but i still have no results.
thanks!