Development Environment: apache2.0.54 + php5.1.6 + mysql5.0.26
Encoding: in order to make PHP and MySQL better support Chinese, will adopt UTF-8 encoding, the related configuration is as follows.
1. MySQL configuration, after installing MySQL, the character encoding is changed to UTF-8, that is, the second item is selected. Encode each table in a specific database into a UTF-8
2. There is no need to change in Apache because UTF-8 encoding is included
3. Line in the PHP. ini file
637: remove the semicolon before extension = php_mbstring.dll, and modify the relevant encoding configuration of mb_string. The modified content is as follows:
Line
1164: mbstring. Language = UTF-8
Line
1169: mbstring. internal_encoding =
UTF-8
Line 1172:
Mbstring. http_input = auto
Line
1176: mbstring. http_output =
UTF-8
Line
1183: mbstring. encoding_translation =
On
Line
1187: mbstring. detect_order = auto
Line
1191: mbstring. substitute_character =
UTF-8;
Line
1201: mbstring. func_overload =
1
(All row numbers correspond to PhP. ini-recommand of php5.1.6)
4. In the statement
$ Mysql_link = mysql_connect ($ mysql_host,
$ Mysql_user, $ mysql_pass );
Add
Mysql_query ("set names 'utf8 '");
Note: utf8 cannot be written as a UTF-8, otherwise it does not work