CREATE table with Navicat for MySQL, insert Chinese garbled
section has encoding settings.
garbled, it must be the code you're using to mess it up.
Workaround:
The first step is to change the database code first
first modify your database, if your page with UTF-8 encoding then your database encoding needs to be set to UTF-8, each field needs to be set. To maintain consistency inside and outside, you can use the Navicat for MySQL tool, this tool can be seen very clear, if the table \ A lot of fields, you can export SQL statements, and then replace the corresponding code in SQL statements such as gb2312 Replace with UTF8, and then re-create a library, the creation of the character set selection UTF8 the SQL statement import, check that all the code is UTF8 OK
Second Step program modification
when 1\ read the library,
mysql_query ("Set names UTF8");
2\ each page header with a sentence
header ("content-type:text/html; Charset=utf-8 ");
3\ Check that all encoding declarations are correct
<meta http-equiv= "Content-type" content= "text/html; charset=utf-8" >
4\ Check the page of the existing text used by the correct encoding, it is recommended that you use EditPlus in the lower right corner of the display UTF-8 or ANSI, to ensure that all the files with Chinese open after the display of the encoding set is UTF-8, if not, you can open all the files and choose from the menu " Document "-" File Encoding "-" file Encoding (multiple files) ", then select all the file point OK, change the encoding to UTF-8 OK!
OK to this position is done, all the code is consistent, absolutely no longer garbled, say a word. For the choice of MySQL operation tool I only recommend two, one is familiar with phpMyAdmin and then navicat for MySQL also have a lot of people are in use.
Database--garbled display in table