Searches in mysql - Accented letters

Asked

Viewed 29 times

0

Currently I do my search as follows:

SELECT * FROM cadastro WHERE nome LIKE '%são%'

This way does not return me a result, however, when I put only the ã capitalized à I get the result.

That’s how it works:

SELECT * FROM cadastro WHERE nome LIKE '%sÃo%'

Could you answer me how I can solve this problem?

1 answer

0

Change the type of encoding your bank uses, do so

 ALTER DATABASE `seu_banco`CHARSET = UTF8 COLLATE = utf8_general_ci;
  • My bank already has that encryption.

  • Within LIKE, you will use texts or concatenate with variables?

  • In this case only text.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.