I 'd like to ask you a question about php + mysql character encoding. thank you.

Source: Internet
Author: User
Tags website server
I would like to ask you a question about php + mysql character encoding. thank you for setting the website to UTF8. I have checked a lot of information and understood the truth, the page, program, and database characters are encoded in a unified manner. The reason is clear, and I don't know how to do it.

I can't control the MYSQL configuration of someone else who rents the website server space.


The dreamweaver5 is designed for the page. the default encoding is UTF-8. What else do I need to do?


Reply to discussion (solution)

The front-end character set has no direct relationship with the character set saved by the database. Again, MySQL database supports multiple types of character sets, as long as you choose the character set of the database as the UTF-8 when installing, then your data will be saved to the database according to the UTF-8.

The database is human, and you naturally cannot modify the settings.
What you can do is
1. add a connection to the Chinese field during table creation to verify gbk_chinese_ci or utf8_general_ci
Tell mysql which character set to store data
2. after connecting to the database, run the set names gbk or set names utf8 command.
Tell mysql which character set to use to communicate with him

How to add link verification for Chinese fields?

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.