PHP MySQL Greek letters showing like ???? marks(PHP MySQL 希腊字母显示为 ????分数)
问题描述
我有一个包含一些文本的表格,文本是希腊字母,当我使用 sql 工具并从该表格中选择数据时显示正确
I have a table with some text and text is greek letters, when i use sql tool and select the data from this table is showing correctly
但是当我使用 mysql_fetch 数组显示我的站点前端时,当回显时它显示如下
But when i show this my site frontend using mysql_fetch array and when echo it shows as below
任何人都知道如何解决这个错误谢谢.
Anyone know how to fix this error thank you.
推荐答案
请尝试以下操作:
在您连接到 mysql 后,执行此查询以确保您使用的是 UTF8:
after you connect to the mysql, do this query to make sure that you are using UTF8:
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
确保在 HTML (head) 中使用正确的编码,尝试:
make sure that in HTML (head) you are using the right encoding, try:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
如果这没有帮助,请尝试不同的编码,例如 ISO-8859-1
if this does not help, try different encoding, like ISO-8859-1
这篇关于PHP MySQL 希腊字母显示为 ????分数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP MySQL 希腊字母显示为 ????分数


基础教程推荐
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- php中的PDF导出 2022-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
- 将变量从树枝传递给 js 2022-01-01
- php中的foreach复选框POST 2021-01-01
- Web 服务器如何处理请求? 2021-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01