How to store chinese characters in MySQL table?

I am having a textarea which i can store text in Mysql table. But when I try to enter chinese text, it will get stored as ???????????. The column is a text column with unicode encoding.
Who is Participating?
nizsmoConnect With a Mentor DeveloperCommented:
What are you entering it in?

Following may be helpful:


mysql_connect ( 'localhost', 'user', 'pass' );
mysql_select_db ( 'my_database' );

// set utf8 unicode mode
mysql_query ( 'SET NAMES utf8' );  // This is the important line

// continue script...


Also if you wanted to display chinese characters you would need to have this in your html:
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />

Please let me know how you get on.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.