Phpadmin and Dreamweaver Test SQL instructions in Chinese display as question mark questions, please php+mysql expert answer

Source: Internet
Author: User
Tags mysql code dreamweaver
Phpadmin and Dreamweaver Test SQL instructions in Chinese display as question mark questions, please php+mysql expert answers
I used the Wamp,apache+php+mysql phpadmin to tabulate the database, and in phpadmin I've adjusted all the character sets to gb2312


Include Preferences in PHP Web pages

, and also adjusted the MySQL code, the code for the database (including fields, table) is gb2312


However, when testing, the page still cannot display the PHP section of Chinese (displayed as a question mark)


The character set of the show variables in cmd has been viewed,

Tried the separate execution: set character_set_xxxx=gb2312;

Even if the whole display is gb2312, still invalid;



Attempt to write up set NAMES gb2312 or add set NAMES gb2312 in *.sql and repeatedly import and export to read and write, invalid;



Also tried to modify the default Default-character-set=utf8 in My.ini invalid (cannot start after modification);



It is also invalid to attempt to unify all the coding involved into utf-8.



Ask the expert to answer the question where it appears?

I'm new, but I'm asking for details. If it can be resolved, be grateful, add 100, words will be done.

-------------------------



Win7x64

Apache 2.2.21

PHP 5.3.8

PHP Extension: mysqli

MySQL 5.5.16

MySQL Client version: Mysqlnd 5.0.8-dev-20102224-$Revision: 310735 $

phpadmin:3.4.5
MySQL PHP SQL Dreamweaver Test


------Solution--------------------
It is important to note that all changes to the character set settings do not affect the data in the library.
The only effect is to change the data after setting
------Solution--------------------
1, confirm php file asked gb2312 code
2, the query before execution: mysql_query ("SET NAMES gb2312");
------Solution--------------------
Analysis Method:
1. Verify that the Chinese you inserted into the database is a question mark. If so, that's the problem with inserting the data, execute before you run the INSERT statement: mysql_query ("SET NAMES gb2312");
2. If the database data is normal, it is your page encoding error carefully check the meta information word is correct, you can also directly copy the other local source code, meta.
3. If it is not resolved, add: mysql_query ("SET NAMES gb2312") before reading the data code of the database;
I hope my answer will be of help to you.
  • 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.