Netzflut

Webdesign, Webentwicklung, Drupal & Zeuchs

MYSQL Encoding

Inhaltsverzeichniss

    http://stackoverflow.com/questions/3735139/how-to-do-mysql-queries-on-text-with-umlauts-in-drupal

    Convert

    http://en.gentoo-wiki.com/wiki/Convert_latin1_to_UTF-8_in_MySQL

    utf8_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;

    WICHTIG:

    Ä = A
    Ö = O
    Ü = U
    ß = s

    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 Ö

    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) )
    Design&Code: