Summary - Sending and Fetching Non-ASCII Text

This section provides a quick summary on sending and fetching non-ASCII character strings to and from MySQL server.

Looking back on tests I did in this chapter and the previous chapter, here are some simple rules you need to follow when sending and fetch non-ASCII text to and from MySQL server:

Applying those rules to a Chinese web site, my suggestions would be:

By the way, MySQL offers a special SET command:

SET NAMES <encoding_name>

This is command is equivalent to 3 sET commands:

SET character_set_client = <encoding_name>
SET character_set_results = <encoding_name>
SET character_set_connection = <encoding_name>

Last update: 2015.

Table of Contents

 About This Book

 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

 Sending Non-ASCII Text to MySQL in Latin1 Encoding

 Sending Non-ASCII Text to MySQL in UTF8 Encoding

 Sending Non-ASCII Text to MySQL in GBK Encoding

 Sending Non-ASCII Text to MySQL in Big5 Encoding

 Sending Non-ASCII Text to MySQL in Multiple Encoding

Summary - Sending and Fetching Non-ASCII Text

 Retrieving Chinese Text from Database to Web Pages

 Input Chinese Text Data to MySQL Database

 References

 PDF Printing Version