Ask me to insert Chinese characters to MYSQL, but phpmyadmin is blank. what should I do?

Source: Internet
Author: User
Ask me to insert Chinese characters to MYSQL, but phpmyadmin is blank. what should I do? Ask me to insert Chinese characters to MYSQL, but the corresponding field of phpmyadmin is blank. what should I do?


Reply to discussion (solution)

Where to insert it?

The problem is not clearly stated

Check whether the variable name is wrong.

The problem is not clear enough. It may not be inserted at all. In addition, Chinese characters may be encoded and cannot be displayed.

Sorry, I didn't make it clear.
I am using a method written in PHP to execute the insert command.
Function newreader ($ name, $ pass, $ email)
{
// $ Str = "insert into reader ('name', 'password') VALUES (" '. $ name. "'," '. $ pass ."')";
$ Str = "insert into reader (name, password, email) values ('". $ name. "','". $ pass. "','". $ email. "')";
// Var_dump ($ str );
Try
{
Mysql_query ($ str );
}
Catch (Exception $ e)
{
Var_dump ($ e );
}
}

However, after the execution, we can see in MYSQL that if the inserted name is Chinese, it will not be blank or question mark (?) in the database (?)
The character set of the database uses: UTF-8 Unicode (utf8)
Connection proofreader selected: UTF-8_general_ci
My webpage has also been set:
Mysql_query ("set names utf8 ");


What should I do if I can insert Chinese characters? Thank you.

If the English and numbers are inserted normally, but the Chinese language is abnormal, it is the encoding problem. convert the encoding.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.