我有以下代码:
<?php
$url1=$_SERVER['REQUEST_URI'];
header("Refresh: 600; URL=$url1;");
header("Content-type: text/xml");
try
{
$db = new PDO("sqlite:/bigdb.sql");
$result = $db->query('SELECT "value" FROM event_log AS t1 JOIN (SELECT MAX("time") AS max_time FROM event_log WHERE "eid" = 7) AS t2 ON t1."time" = t2.max_time WHERE t1."eid" = 7');
$xml_output = '<?xml version=\"1.0\"?>\n';
$xml_output .= "<entries>\n";
foreach($result as $row)
{
$xml_output .= "\t<entry>\n";
$xml_output .= "\t\t<WarmIn>" . $row['value'] . "</WarmIn>\n";
$xml_output .= "\t</entry>\n";
}
$xml_output .= "</entries>";
$db = null;
}
catch(PDOException $e)
{
echo 'Exception : '.$e->getMessage();
}
?>
这并没有显示任何值,但是,如果我只想将数据显示为纯文本,没有XML,它可以工作,但现在,保持原样,页面只是空白,没有错误。
有什么建议吗?