PHPcharactergarbled, charactergarbled_PHP tutorial

Source: Internet
Author: User
PHPcharactergarbled and charactergarbled. PHPcharactergarbled, charactergarbledMySql console query garbled DatabaseTable character set displayed in the Mysql console is different from the character set displayed in the right-click mysql console border PHP character garbled, charactergarbled

Garbled characters appear during query on the MySql console

The character sets of Database and Table are different from those displayed on the Mysql console.

Right-click the mysql console border and clickAttributeViewCurrent code pageWhether the character set mode of is the same as the character set mode of the database

View database character setsShow variables like '% char %';

The main points are: character-set-client = gbk character-set-server = gbk character-set-result = gbk.

Solution: set the character mode of the database.

Alert database Database_name default character set gbk;

Alert database Database_name default character set utf8 default collate utf8_geberal_ci;

Collate utf8_geberal_ci: the utf8 character proofreading mode gbk cannot be found. please leave a message.

No effect. open it.My. iniModify default-character-set = gbk character-set-server = gbk

Specify:

Create database Database_name character set gbk;

Page garbled: On Dreamware, find the page property to set the character mode.

If there is a link to Mysql, it should be consistent

Database + page character set + HTML head + Set names gbk)

The query database on the page obtains garbled characters:Mysql, page character set, whether mysql and PHP transfer characters are the same

Set the apache configuration file httpd. conf to add or modify the default apache character startup mode: AddDefaultchars gbk

Directly set the transmission character mysql> set names gbk

Mysql_query ("set names gbk", $ conn );

Mysql_close ();

?>

Http://www.bkjia.com/PHPjc/980030.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/980030.htmlTechArticlePHP character garbled, charactergarbled MySql console query garbled DatabaseTable character set displayed in the Mysql console character set is not the same right click mysql console border...

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.