Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Persian character's issue in mysql database

Tags:

php

mysql

persian

When I insert Persian data to database, data will save like this: †Ø¯Ø± 50 لیتری

But when I read data from database and echo it on the web, they are Ok.

I need to read data in my database directly. what is your solution?

Mysql setting:

Server connection collation: UTF8_general_ci

Html file charset is utf8.

like image 848
Saman May Avatar asked Dec 11 '13 12:12

Saman May


1 Answers

I had a same issue,this code: mysqli_set_charset($con, "utf8"); solved my problem!

like image 54
Hamed Ghadirian Avatar answered Oct 10 '22 08:10

Hamed Ghadirian