-1

I saved some German characters on the database by entity (eg. föo => föo).

Now I have a query that search for a match just using LIKE %search_word%. The search_word will probably be an input containing special German characters. Can you suggest of the most efficient way to compare my search_word to the one stored in the database?

Huge thanks.

Leandro Garcia
  • 3,138
  • 11
  • 32
  • 44

2 Answers2

0

use the same entity conversion at search_word before putting it in the query.

or you can stop saving the data whit entity conversion, and do the converstion when you need them insted

Puggan Se
  • 5,738
  • 2
  • 22
  • 48
0

Perhaps this is a valid answer already: MySQL DB selects records with and without umlauts. e.g: '.. where something = FÖÖ'

You have to ensure that the string encoding (e.g. UTF8) and your (MySQL) DB charset do match. Look at what collations do and if utf8_bin can help.

Community
  • 1
  • 1
mdo
  • 6,961
  • 3
  • 24
  • 26