PHP character garbled,charactergarbled_php Tutorial

Source: Internet
Author: User

PHP character garbled,charactergarbled


MYSQL Console Query is garbled

The database&table character set is not the same as the character set shown on the MySQL console

Right-click the MySQL console border Click Properties to see whether the character set mode of the current code page is the same as the database's character set mode

View database character Set show variables like '%char% ';

The main look is:character-set-client=gbk character-set-server=gbk character-set-result=gbk is the same

FIX: Set database character mode

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:utf8 character Proofing mode GBK did not find proofreading, please leave a message.

No effect please open My.ini modify DEFAULT-CHARACTER-SET=GBK CHARACTER-SET-SERVER=GBK

When created, specify:

CREATE DATABASE database_name character Set GBK;

page garbled : Find page properties on Dreamware set character mode

If there is a link MySQL should remain unified

Database + page Character Set +html head +mysql in PHP link character (set names GBK)

The query database in the page gets garbled: MySQL, page character set, MySQL and PHP transfer characters are the same

Set Apache configuration file httpd.conf Add or modify Apache default character startup mode: Adddefaultchars GBK

Direct set transfer character mysql> set names GBK

mysql_query ("Set names GBK", $conn);

Mysql_close ();

?>

http://www.bkjia.com/PHPjc/980030.html www.bkjia.com true http://www.bkjia.com/PHPjc/980030.html techarticle PHP character garbled,charactergarbled mysql console query when there is garbled databasetable character set in the MySQL console display the character set is not the same right-click the MySQL console border ...

  • Related Article

    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.