Advanced Search

Results 1 to 2 of 2

Thread: Mysql Database Multi language Problem

  1. #1
    Join Date
    Apr 2012
    Posts
    81
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Mysql Database Multi language Problem

    Hi,
    My problem is I have set Collation=utf8_bin for Title field.
    I am using Hindi Language. So when I insert from frontend, the output goes in backend properly like if we insert an English language word, it will be stored in as English, if I insert Hindi language word, it will be stored in as Hindi. Things are working perfectly in my Local but when I do the same in Live....., it is not working. I set the Title field Collation=utf8_bin.
    But now when I insert another language word from frontend then whole table's Title field is getting changed to combination of some numeric & string values & it is not working properly.
    So what should I do for it?

    My Local Mysql Server Version is - 5.1.41
    My Live Mysql Server Version is - 5.5.23

    Any Idea?

    Thanks
    Kaushal

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,627
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    Quote Originally Posted by round View Post
    I have set Collation=utf8_bin for Title field.
    "bin" means "binary." For text, you'll generally want a textual collation. For utf-8, the default is "utf8_general_ci", and that's a good choice.

    note, however, that collation has to do with how MySQL sorts your records, not how it stores them.
    You need to make sure your database is using UTF-8 encoding (e.g., by using CHARSET=UTF8 in your table definition).

    Quote Originally Posted by round View Post
    I am using Hindi Language. So when I insert from frontend, the output goes in backend properly like if we insert an English language word, it will be stored in as English, if I insert Hindi language word, it will be stored in as Hindi.
    This is an oversimplification.

    I'm sure there's more than one encoding that can handle Hindi letters. There are many, many charsets that handle the basic latin alphabet (which is why there are very rarely problems with English letters).

    In your case, you need to check not only the database encoding, but also the encoding for your database connection, your HTML page (both the <meta> tag and the HTTP header), and for your PHP script itself. They all need to use the same charset (UTF-8 is [almost always] the best choice).
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

Similar Threads

  1. Replies: 0
    Last Post: 12-20-2010, 05:20 AM
  2. MySQL Database Query problem
    By djvk87 in forum MySQL and other databases
    Replies: 10
    Last Post: 06-29-2010, 01:10 AM
  3. Problem Populating form from mysql database
    By boxelder_bee in forum PHP
    Replies: 3
    Last Post: 08-10-2009, 04:21 PM
  4. problem in MYSQL database design....
    By gurmeet in forum MySQL and other databases
    Replies: 7
    Last Post: 02-07-2009, 11:02 PM
  5. Replies: 9
    Last Post: 06-07-2006, 07:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •