In this post i will explain you how to save unicode data to mysql database using php. Saving a unicode data to mysql database is not easy task for beginners. whenever we can post unicode data from form and save it to database using php it save like this format :-

But we need to save data into original format as shown below :-

Now here is a solution to solve this problem and save unicode to database.

Database:
Create a sample database ‘unicode’ where we can save data

When we create a table for saving unicode we can set unicode data field character to utf8_general_ci as in above mysql query.

index.php

In this page i create a simple form through which i send data to php page and save to database.

unicode.php

In above almost code is same we normally use to save data to database but we need to add

this line of code after we create connection to mysql and when we can save data or perform insert operation over database we need to pass connection parameter to database

Thank you
Happy coding.

Posted in: php