Click here to Skip to main content
16,019,018 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I create database with collation utf8_persian_ci but when i select table in php and its show data look like below:
{"person":[{"id":"1","name":"???","address":"????"}]}

how to edit database mysql for show persian?
Posted
Updated 9-Sep-18 10:02am

Some MySQL connectors allow you to set character set, for example, if you use PHP PDO, you can set the character set in the data source name as follows:

$dsn ="mysql:host=$host;dbname=$db;charset=utf8";

Regardless of which way you use, make sure that the character set used by the application matches with the character set stored in the MySQL database server.
 
Share this answer
 
write this after yor connection
PHP
mysql_set_charset('utf8',$con);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900