Encoding-php uploads an image with a Chinese name that can be displayed and saved to the database. However, the name in the database is a question mark. I don't know how to change it!

Source: Internet
Author: User
Tags php database
Php encoded as: header (& #39; content-type: texthtml; charsetgbk & #39;); added this sentence in php: mysqli_query ($ dbc, & quot; setnames & #39; gbk & #39; & quot;); php script encoding format: ANSI Database link verification: gbk_general_cimysql character set: utf8 I use this sentence: setnames & #39; gbk & #39; change it to & #39; gbk & #39; Encoding character set php database

Php code: header ('content-type: text/html; charset = gbk ');
In php, this sentence is added: mysqli_query ($ dbc, "set names 'gbk '");
Php script encoding format: ANSI
Database link verification: gbk_general_ci
Mysql character set: utf8 I use this sentence: set names 'gbk' to 'gbk'

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.