douhao5280 2016-12-23 22:28
浏览 60
已采纳

phpMyAdmin不会将Unicode(utf-8)字符正确显示到数据库中,但在Web中正确显示[复制]

This question already has an answer here:

sorry if my question is duplicate , after googling i found a answer for my question that says:

 1-go to libraries folder
 2-finding file database_interface.lib.php
 3-comment below code:


  if (! empty($GLOBALS['collation_connection'])) {
  PMA_DBI_query("SET CHARACTER SET 'utf8';", $link, PMA_DBI_QUERY_STORE);
   $mysql_charset = explode('_', $GLOBALS['collation_connection']);
   PMA_DBI_query("SET collation_connection = '" .      PMA_sqlAddslashes($GLOBALS['collation_connection']) . "';", $link,

  PMA_DBI_QUERY_STORE);
   } else {
   PMA_DBI_query("SET NAMES 'utf8' COLLATE 'utf8_general_ci';", $link,      PMA_DBI_QUERY_STORE);
 }

now my problem is i do not have (database_interface.lib.php) in libraries folder

version of my xampp is 3.2.2

</div>
  • 写回答

1条回答 默认 最新

  • dounan9070 2016-12-24 12:56
    关注

    I added below code before any insert and select statements, and now it works.

    $conn->set_charset('utf8');

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

报告相同问题?

悬赏问题

  • ¥15 求Houdini使用行家,付费。价格面议。
  • ¥15 AttributeError: 'EasyDict' object has no attribute 'BACKUP_DB_INFO'
  • ¥15 前端高拍仪调用问题报错
  • ¥15 想用octave解决这个数学问题
  • ¥15 Centos新建的临时ip无法上网,如何解决?
  • ¥15 海康威视如何实现客户端软件对设备语音请求的处理。
  • ¥15 支付宝h5参数如何实现跳转
  • ¥15 MATLAB代码补全插值
  • ¥15 Typegoose 中如何使用 arrayFilters 筛选并更新深度嵌套的子文档数组信息
  • ¥15 CF1927D 求Hack