首先,php 与 mysql 要保持编码一致
其次,有三处注意点:
1.sql 表目 设为 utf8_unicode_ci
2.php
1 header("Content-Type: text/html; charset=utf8");
3.sql
1 mysql_query("set names 'utf8'"); //names not name, utf8 not utf-8
posted on 2014-07-20 20:29 fashare 阅读(148) 评论(0) 收藏 举报
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3