gpt4 book ai didi

Mysql-Html字符串问题

转载 作者:行者123 更新时间:2023-11-29 09:06:29 25 4
gpt4 key购买 nike

我有一个表,在 joomla 中我得到以下数据: enter image description here

1. fc k��ln - vfl wolfsburg
germany 1. bundesliga

所以我创建了一个测试页面,我将 header 设置为utf-8,一切都很好,我收到了想要的数据:

Array
(
[0] => Array
(
[id] => 4e36e64eb34d2
[team1] => 1. FC Köln
[team2] => VFL Wolfsburg
[league] => Germany 1. Bundesliga
[sport] => Soccer
[time] => 2011-08-06 15:30:00
)

)

我还检查了 joomla header ,它包含字符集:

<meta http-equiv="content-type" content="text/html; charset=utf-8" />

我做错了什么?

最佳答案

您的数据库连接必须设置为 UTF8

set the mysql connection charset in includes/database.php file at about line 102 (second line below)

$this->_table_prefix = $table_prefix; 
//@mysql_query("SET NAMES 'utf8'", $this->_resource); // THIS IS THE LINE TO UNCOMMENT
$this->_ticker = 0;
$this->_og = array();

当然你表中的数据必须是utf-8,检查一下。

其他可能要检查的事情是您的浏览器是否将此页面视为 utf8(在 Firefox 中:查看 -> 字符编码)

关于Mysql-Html字符串问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6902415/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com