Storing Unicode in MySQL
Despite the absence of an explicit "nvarchar" type, MySQL supports Unicode storage through its character sets. To store Unicode data, you must select a suitable UTF-8 character set for your table.
Steps to Store Unicode in MySQL:
CREATE DATABASE UnicodeDB; USE UnicodeDB; CREATE TABLE UnicodeTable ( UnicodeColumn TEXT );
ALTER TABLE UnicodeTable CONVERT TO CHARACTER SET utf8;
After this conversion, the "UnicodeColumn" will be able to store Unicode characters.
Note:
The above is the detailed content of How Can I Store and Retrieve Unicode Data in MySQL?. For more information, please follow other related articles on the PHP Chinese website!