现象如标题。
解决思路:
1,在php中添加
header(‘charset=utf-8‘);
2,在连接到数据库后,添加如下代码,写入数据和获取数据的地方均要添加
mysql_query("SET character_set_results = ‘utf8‘, character_set_client = ‘utf8‘, character_set_connection = ‘utf8‘, character_set_database = ‘utf8‘, character_set_server = ‘utf8‘", $con);
时间: 2024-10-03 02:17:18