Insert Unicode Data Into MySQL Database in PHP

Insert Unicode Data Into MySQL Database in PHP

In order to insert unicode data into MySQL database, you will need to create tables using unicode support:
mysql> set names ‘utf8′;
mysql> create database test_database character set utf8 collate utf8_unicode_ci;
mysql> use test_database;
mysql> create table test_table (name varchar(255) character set utf8 collate utf8_unicode_ci);
Now use PHP to insert data into the new table:

That’s it.

Leave a Reply

Your email address will not be published. Required fields are marked *

My new Snowflake Blog is now live. I will not be updating this blog anymore but will continue with new contents in the Snowflake world!