Php coding-php Tutorial

Source: Internet
Author: User
When php encoding is used to operate the database, Chinese characters are added to the table, but not displayed in the database... Excuse me: what encoding does this php file use? Do I need to set setnamesgbk for mysql databases? How to set the encoding? Cainiao is asking for advice .. ------ Solution -------------------- showvariableslike % char %; is it under the command line? S about php coding
When you use php to operate databases and add Chinese characters to tables, the database cannot be displayed... Excuse me:
What encoding is used for this php file?
Do I need to set names gbk for mysql databases?
How to set the encoding? Cainiao is asking for advice ..

------ Solution --------------------
Show variables like '% char %'; is it in the command line?
Set names utf8 only applies to the current connection. After the php program is executed, the connection is disconnected, even if it becomes invalid.

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.