drwf69817 2016-10-11 18:17
浏览 194
已采纳

使用utf8mb4的PHP / mysql站点不能正确地从数据库中检索表情符号,尽管在任何地方都指定了utf8mb4,我可以找到它来放置它

I converted my mysql 5.7 database to utf8mb4 today.

As a test, I've put a poo emoji (

  • 写回答

1条回答 默认 最新

  • dongzanghong4379 2016-10-12 08:19
    关注

    The problem was an outdated version of Navicat. Upgrading from 8 to 11 has fixed my issues. I realised this was probably the cause when I discovered that emojis INSERTed via php were correctly stored and retrieved in PHP, but wouldn't show correctly in Navicat.

    Similarly the opposite was true; emojis set in Navicat would correctly store and retrieve in Navicat, but not in PHP.

    Looking at the encoding options for navicat connections, it had a checkbox for "use mysql encoding", but if left unchecked the dropdown of possible options included only utf8, not utf8mb4. I guess navicat 8 pre-dates that being in common usage.

    A quick upgrade, and everything works perfectly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 ansys fluent计算闪退
  • ¥15 有关wireshark抓包的问题
  • ¥15 需要写计算过程,不要写代码,求解答,数据都在图上
  • ¥15 向数据表用newid方式插入GUID问题
  • ¥15 multisim电路设计
  • ¥20 用keil,写代码解决两个问题,用库函数
  • ¥50 ID中开关量采样信号通道、以及程序流程的设计
  • ¥15 U-Mamba/nnunetv2固定随机数种子
  • ¥15 vba使用jmail发送邮件正文里面怎么加图片
  • ¥15 vb6.0如何向数据库中添加自动生成的字段数据。