首页 > 代码库 > mysql,php字符乱码

mysql,php字符乱码

show variables like "character%"查看字符编码

if:

character_set_client latin1
character_set_connection latin1
character_set_database utf8
character_set_results latin1
character_set_server utf8
character_set_system utf8

then:

SET NAMES UTF8

else if:

character_set_server latin1

then:修改my.ini,在*sqlid后加上

set character_set_server=utf8

 

mysql,php字符乱码