dro44817 2011-07-03 13:10
浏览 30
已采纳

£sign encoding -help!

I have a simple update set php sql function on my site where I can update the prices in my database for products on the webpage.

I have set the collation for all text fields in mysql to utf8_unicode_ci, and included

<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/> 

in all my pages. When I submit the edit button however, if I enter £200 for example, in the database instead of &pound;200 it enters &Acirc;&pound;200.

I have read through countless forums on the issue and dont know what more I need to do to get this working - also, most of the discussions are at least 3 years old. Is there any new function I might be able to use to get this very small, but very frustrating glitch fixed?!

Thanks JD

  • 写回答

1条回答 默认 最新

  • douwen1937 2011-07-03 13:15
    关注

    Add this line of PHP code, immediately after connecting to the MySQL database:

    mysql_set_charset('utf8');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元