doubianyu7844 2013-01-30 01:44 采纳率: 0%
浏览 64
已采纳

从mysql 5.5降级到5.1,utf-8 general_ci

i am using wamp for localhost, its mysql version is 5.5. After i finished my website i wanted to upload it to my website (shared hosting). which runs (5.1) but i cant insert arabic letters anymore.

when i insert any field in arabic, it gets stored as weird characters "ضووع".

it was doing great on my pc, but not online.

the database is myisam by default, but all tables are innodb with utf8_general_ci. also this is the same database i used on my machine (innodb by default) (I've imported it into my new database on the shared hosting).

so far i tried those things after making the connection

mysql_set_charset('utf8');

and

mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_unicode_ci'");

what can i do more?

  • 写回答

2条回答 默认 最新

  • duanpi7107 2013-01-30 14:17
    关注

    this happened to me once, i was using htmlentities() , but when i used htmlspecialchars($string, ENT_QUOTES, 'UTF-8'); the problem solved.

    hope you have the same problem.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部