如何在phpmyadmin中插入utf8(马拉地语印度语)?
这是我的表:
| name | cicy |
----------------------
| priti | abc |
----------------------
这是预期的表格:
| box | indate |
----------------------
| प्रीती | एबीसी |
----------------------
答案 0 :(得分:1)
您应该设置PHP数据库客户端,以正确的格式提供和提取存储的数据。这应该在调用myqsl_connect()
函数后立即完成:
$mysql_link = mysql_connect($host, $username, $password);
mysql_select_db($database, $mysql_link); mysql_query(‘SET character_set_results=utf8′);
mysql_query(‘SET names=utf8′);
mysql_query(‘SET character_set_client=utf8′);
mysql_query(‘SET character_set_connection=utf8′);
mysql_query(‘SET character_set_results=utf8′);
mysql_query(‘SET collation_connection=utf8_general_ci’);
also, you should add this META tag to your page to inform the browser that your page is UTF-8 encoded:
It is good also to add HTTP header through PHP header() function:
header(“Content-Type:text/html; charset=utf-8″);