Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to save other languages in mysql table?

Hi I have to save hindi languages in mysql. how can I do that. any one knows the solution please help me.

like image 704
DEVOPS Avatar asked Dec 29 '10 20:12

DEVOPS


People also ask

What language does MySQL use?

MySQL is a freely available open source Relational Database Management System (RDBMS) that uses Structured Query Language (SQL). SQL is the most popular language for adding, accessing and managing content in a database.


1 Answers

You need to store all text as UTF8, then you'll be able to see Hindi characters. You can update a column to use UTF8 with a query like the following:

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

Since you use PHP, make sure that all your PHP scripts are saved as UTF8. You can also set the connection charset with the following query:

SET NAMES 'utf8'

This will ensure that your web server and database servers communicate using UTF8.

like image 166
alexn Avatar answered Sep 22 '22 08:09

alexn