0

I'am trying to SELECT a cloumn in the table which contains only vowels. It works fine till I try to select entries with german umlauts (special chars like ä,ö,ü), then the query makes no difference between u<->ü, o<->ö, a<->ä

SELECT vowels 
FROM words
WHERE vowels LIKE 'ü'
// this also selects all entries with simple 'u'

Collation of the database is UTF8, document is formatted in UTF8, I'am using $mysqli->set_charset("utf8");

Any ideas how to get that working? Thanks!

Crayl
  • 1,883
  • 7
  • 27
  • 43

2 Answers2

2

one way is to use the utf8_bin collation.

goat
  • 31,486
  • 7
  • 73
  • 96
1

you can use COLLATE to change the collation on the fly

SELECT vowels COLLATE utf8_bin as vowel
FROM words
WHERE vowel LIKE 'ü'

not tested

dockeryZ
  • 3,981
  • 1
  • 20
  • 28