我注意到我的实时和测试站点之间在mysql查询上存在差异。
以下是每个网站的相同代码:
$query = "SELECT F.`Artist`, F.`Title`
FROM myTable AS F
WHERE userID='$uID'
ORDER BY `Artist`, `Title`;";
if (!($result = mysql_query($query))) send(3070,"e");
$songs=array();
while ($row=mysql_fetch_array($result, MYSQL_ASSOC) ) { $songs[]=$row; }
//write a test file of the results array...
$myFile = $_SERVER["DOCUMENT_ROOT"].'/test.txt';
$fh = fopen($myFile, 'w') or die("can't open file");
fwrite($fh, print_r($songs,true));
fclose($fh);
实际网站的结果是正确的:
Array
(
[0] => Array
(
[Artist] => A GREAT BIG WORLD & CHRISTINA AGUILERA
[Title] => Say Something
)
)
但是测试网站正在将字符转换为他们的html实体版本......
Array
(
[0] => Array
(
[Artist] => A GREAT BIG WORLD & CHRISTINA AGUILERA
[Title] => Say Something
)
)
两个数据库中存储的数据是相同的:
[Artist] => A GREAT BIG WORLD & CHRISTINA AGUILERA
[Title] => Say Something
我无法看到两个站点代码之间存在任何差异。知道为什么会这样吗?
感谢您的时间和帮助。