Hello,
I am creating a site in spanish. People are going to be searching stuff by person name. Some people may enter the name with accent and some dont. My idea was to create an extra field in the table to keep the not_accented name. At the time of the search just remove the accent and search againt the no accent column.
First, if you have a better idea, let me know.
The problem is that I dont seem to be able to remove the accent. I tried the functions in php.net for strtr but they dont seem to work. I always get the same input word.
my page have the content uf8 and mysql table is utf8
any ideas.
remove accent
Moderator: General Moderators
- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: remove accent
You could try converting the charset to latin1 in MySQL (during the match, no need for a separate column):
also, it should leave both your dataset and form untouched.
Code: Select all
SELECT * FROM `sometable` WHERE CONVERT( _utf8 '$name' USING latin1 ) LIKE CONVERT( _utf8 `name` USING latin1 )Re: remove accent
Hello, sorry it took so long , but I always get a syntax error when running that sql.