PHP MySQL 希腊字母显示为 ????分数 [英] PHP MySQL Greek letters showing like ???? marks

查看:26
本文介绍了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 希腊字母显示为 ????分数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆