MySQL inserted in Chinese will not be able to insert a hint exception
Source: Internet
Author: User
MySQL inserted in Chinese will not be able to insert a hint error
Error
MySQL return:
#1366-incorrect String value: ' \XE4\XBD\XA0\XE5\XA5\XBD ' for column ' StrConnect ' at row 1
------Solution--------------------
Most of the coding problems, MySQL does not support to have such a mistake.
What is your database field type??
------Solution--------------------
MySQL, the default character encoding test Latin1, sometimes is already utf8, but also reported 1366.
To encode the inserted string as UTF8, modify the table's encoding to UTF8, the problem should be resolved.
------Solution--------------------
mysql_query ("Set names ' GBK '");//This is the specified database character set, which is usually placed after the statement that connects to the database.
Single quote ' specified character set to convert '
------Solution--------------------
Http://hi.baidu.com/fish124423/blog/item/3e301ab411a01ec636d3ca3b.html
Look at this, I've solved the problem as above!
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.