We have a database in MySQL that contains data with accentuated characters (Brazilian Portuguese). The scripts system is in PHP.
When it is made a search in this database, the system seeks and it returns records from the database that match exactly the characters, as they were typed. For instance: if the user types in the search field "São José" (accented), the system doesn't find records that contains "Sao Jose" (without accents). Still, if the search is made by "Sao Jose" (without accents), the system doesn't find records that contains "São José" (accented).
Does some way exist that PHP/MySQL returns all of the occurrences in function of the characters, ignoring its accentuation, in other words, independently if the characters in the database OR search field are or not accentuated?
I think your main problem here is data integrity. The two phrases aren't the same from an ascii point of view. I would suggest streamlining the data when it is inserted into the db. Either, removing all accents or making sure they are all there(which is alot of work). We did have a discussion about removing special chars that might help.
Hello Valterg, I have a database with spanish accents and all, and I get results by using LIKE in my SQL statement: select * from some_table where nombre LIKE '%Mexico%' This matches records containing México (accented) and Mexico (no accent).
How do you have your SQL statement? Hope this helps.