doubianyu7844 2013-01-30 09: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 22: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条)

报告相同问题?

悬赏问题

  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料