0

Save Multi language Data in Mysql Database

How to store Multi language Data in Mysql Database.

We assume we have a DataBase with table news, and a column named posts, which will save the news written in your website.We know that all major DataBase’s support UTF8. And we shall explore that feature.
Now we write a article in hindi, हेल्लो वर्ल्ड
If the UTF8 is not specified, you should see something like ?????? in ur DataBase otherwise you should see the hindi data. Clear? Now lets see the code given below:

First check for UTF8 compatibility with this query. If it supports you should see the output as

Now that being checked, alter the table and just modify the column, which is ‘text’ in our above example and specify it as UTF8

Then execute following query before inserting into the table:

Now, try to insert the hindi value and save it. Query it and u should see the hindi text

Sandeep Kumar

Sandeep kumar is a web developer and a professinal blogger. He works for latest technologies and write articles what he learn. In ICodeHub he share web languages tutorials and other programming tips and tricks. if you need some help or have some suggestion then mail him at sandeep92pal@gmail.com without any hesitation. He believes in learning and sharing.