Store and display Unicode string (हिन्दी) with MySQL using PHP

10 minutes read

How to manage international languages in MySQL database using php ?

Foreign-Languages-using-MySQL

If you want to store multiple languages like Arabic, French, Hindi or Urdu to your MySQL database, default settings is not valid to do that to insert all languages in database. If you insert data in your database and database is not configured as I am going to show you in this tutorial then your data will be look like special characters निम and your data will lost .

 

So now i am going to tell you how to configure database to accept Unicode strings (हिन्दी).

Very important HTML settings you have to add a meta for character set UTF-8

In HTML5

Create table in your database with CHARACTER SET utf8 COLLATE utf8_bin

 

Facebook Twitter LinkedIn Telegram Whatsapp

Related Posts:

“How to Export MySQL data to Excel in PHP ?” This script will used to export data into .xls format from mysql database.You need to just copy this code and update database connection details. Below code will export mysql data into excel (.xls format) with ever...
If you want to strip line feeds, carriage returns, and tabs you can use: $string = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '', $string); 1 $string = preg_replace('/[\x00-\x1F\x80-\x9...
What is PHP ? PHP stands for Hypertext Preprocessor and is a server-side language. PHP allows web developers to create dynamic content that interacts with databases. PHP is relatively new (compared to languages such as Perl (CGI) and Java) but is quickly becom...