I have a procedure that searches through the database and returns the results based on the condition passed as an argument. For instance;
CALL myProcs('Björn');
This query will return all users that has ‘björn’ in their names. However, I’d like to retrieve the same results when the parameter is passed as ‘bjorn’ (notice the ‘ö’ and ‘o’). If it was only one character then there would be no problem but I’d like to achieve the same thing for :
i => ı, ö => o, ü => u, ë => e etc etc...
What is the easiest approach to achieve this goal? I am using php 5+ and Mysql.
You could set a specific collation for your database tables (http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html) which would allow for correct comparison between ignorable characters. For ex:
Ä = A ; Ö = O ; Ü = Uutf8_general_ciandutf8_unicode_ciboth have the desired effect.Cheers