problem with inserting greek characters in database

Discussion in 'PHP' started by neha2011, May 30, 2011.

  1. #1
    Hi

    I have problem when inserting greek characters in mysql database

    After the insert, the greek characters look like this:&#___;&#___;&#___;&#___; where the _ is a number. (I can't paste it here, because on preview the greek characters are displayed right.)

    MySQL version is 5.0.77
    My database have utf8_unicode_ci collation. All fields in the table have same collation utf_8_unicode_ci collation.

    Php document where the form is submitted have the following encoding

    <meta http-equiv="Content-Type" content="text/html; charset=*UTF-8" />
    I also try with
    <meta http-equiv="Content-Type" content="text/html; charset= ISO-8859-7" />

    However, the result remain the same. In phpmyadmin, the characters are displayed as:&#___;&#___;&#___;&#___;

    I would like to know what encoding should I use in order to get Greek characters in mySql database. Anyone have any idea?
     
    neha2011, May 30, 2011 IP
  2. DomainerHelper

    DomainerHelper Well-Known Member

    Messages:
    445
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    100
    #2
    Your database and table Collation needs to Be UTF-8 and If you are on a vps or dedicated, try adding to your my.cnf:

    default-character-set=utf8
    Code (markup):
    Sometimes it is needed to not only change the Collation of the column, but also the table and database themselves.

    in phpmyadmin, choose a table and click OPERATIONS and change the collation there. You can also choose no table and click OPERATIONS to perform it on all tables.
     
    DomainerHelper, May 30, 2011 IP
  3. DomainerHelper

    DomainerHelper Well-Known Member

    Messages:
    445
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    100
    #3
    DomainerHelper, May 30, 2011 IP