dongzhashou0116 2019-03-09 22:32
浏览 64

MYSQL + PHP试图插入IPA字符

I'm having an issue inserting phonetic pronunciations into my database. Here's some images showing what I've done, and the result at the end.

Here's my table layout :

enter image description here

I've added the header on the file that I'm running the script on :

enter image description here

On the web page, the encoding is fine :

enter image description here

Here's how it's uploaded into the database :

enter image description here

Thanks guys please give me some insight on what I'm doing wrong. I'm using phpmyadmin, and on the column for the ipa I'm using utf8mb4_bin

  • 写回答

2条回答 默认 最新

  • dongqun1656 2019-03-09 22:44
    关注

    I've solved it myself, because I'm using PDO I simply added charset=utf8 to the connection string

    $DB = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8",$user,$pass);
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题