November 24, 2010

How to insert chinese character in mysql table?

Question by user319198

I want to save data in Chinese language in mysql table.

Can anyone tell me what settings I have to do for it in mysql and PHP.

My table will save data in both English and Chinese some column English other Chinese . Is it possible with single table.

Any help will be appreciated.

Answer by Guixing Bai

Use UTF-8 when you create table

create table xxx ()CHARACTER SET = utf8;

Use UTF-8 when you insert to table

set names utf8; insert into xxx (xx,x);

Answer by Starx

Set the character set to UTF-8, in mysql.

Check this for reference

http://confluence.jetbrains.net/display/TCD/Configuring+UTF8+Character+Set+for+MySQL
http://dev.mysql.com/doc/refman/5.0/en/charset-mysql.html

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!