Chinese Web Sites Using PHP - v2.23, by Herong Yang
Steps and Application Components Involved
This section describes steps and application components involved in saving Chinese text into MySQL database through Web forms and retrieved it back to Web pages.
In order to create a Web form to take Chinese input text into MySQL database and retrieve it back to a Web page, you need to understand how a Chinese input text is being created and transferred through various application components to reach MySQL database, retrieved back to a Web page. Here is a simplified diagram that shows the steps and application components involved in this process:
W1. Key Sequences from keyboard | |- Web browser v W2. HTTP Request | |- Web server v W3. CGI input | |- PHP engine v W4. SQL statements | |- MySQL v W5. Database tables | |- MySQL v W6. Result sets | |- PHP engine v W7. CGI output | |- Web server v W8. HTTP response (HTML document) | |- Web browser v W9. Chinese characters on the screen
If you decided to use UTF-8 encoding to handle Chinese characters, you need to make sure that all applications mentioned in the above diagram are friendly to UTF-8 encoding. See the following picture:
Table of Contents
PHP Installation on Windows Systems
Integrating PHP with Apache Web Server
charset="*" - Encodings on Chinese Web Pages
Chinese Characters in PHP String Literals
Multibyte String Functions in UTF-8 Encoding
Input Text Data from Web Forms
Input Chinese Text Data from Web Forms
MySQL - Installation on Windows
MySQL - Connecting PHP to Database
MySQL - Character Set and Encoding
MySQL - Sending Non-ASCII Text to MySQL
Retrieving Chinese Text from Database to Web Pages
►Input Chinese Text Data to MySQL Database
►Steps and Application Components Involved
Inputting Chinese Text to MySQL Database in UTF-8
Inputting Chinese Text to MySQL Database in GBK
Inputting Chinese Text to MySQL Database in Big5