How to save other languages ​​in mysql table?

Hi, I need to save Hindi languages ​​in mysql. How should I do it. Anyone know the solution, please help me.

+5
source share
1 answer

You need to save all the text as UTF8, after which you can see the Hindi characters. You can update the column to use UTF8 with a query that resembles the following:

ALTER TABLE posts MODIFY title VARCHAR(255) CHARACTER SET UTF8;

Since you are using PHP, make sure all your PHP scripts are saved as UTF8. You can also establish a connection chain with the following query:

SET NAMES 'utf8'

This will connect your web server and database servers using UTF8.

+11
source

All Articles