Webdevelopment
Drupal
Betriebssysteme
Design
Sonstige
So., 01/07/2012 - 20:45
Body
http://stackoverflow.com/questions/3735139/how-to-do-mysql-queries-on-text-with-umlauts-in-drupal
WICHTIG:
The problem is that since the node table and the title column have utf8_general_ci collation, MYSQL does not treat o and ö umlaut
differently and this query returns nodes starting with O AND nodes starting with Ö
Convert
http://en.gentoo-wiki.com/wiki/Convert_latin1_to_UTF-8_in_MySQLutf8_general_ci
http://dev.mysql.com/doc/refman/5.1/de/charset-unicode-sets.html- ALTER TABLE term_data CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;
- Ä = A
- Ö = O
- Ü = U
- ß = s
Tips
- SELECT * FROM `term_data` WHERE name='Boden1' COLLATE utf8_bin
- if($result = db_query("SELECT tid FROM {term_data} WHERE vid = '%d' AND name = '%s' COLLATE utf8_bin", $vid, $termname) )
Webdevelopment
Add new comment