页面设置了utf8,mysql也是,数据库中里中文还是乱码

解决方案 »

  1.   

    php程序里header('Content-Type: text/html; charset=utf-8');
      

  2.   

    都设置了mysql_query("SET NAMES 'utf8'");
    mysql_query("set character set 'utf8'"); 
    header('Content-Type: text/html; charset=utf-8');
      

  3.   

    mysql_query("set character set 'utf8'");  这句可不要。你的数据来源于php文件还是浏览器提交的?表是什么编码,字段是什么编码。贴出 show create table... ; 看看。
      

  4.   

    还有代码的编码设置也要是utf-8啊!