我在以下代码中遇到此错误,但我无法解决。 我已经使用十六进制编辑器进行了操作,一切似乎都没问题。 有人能帮助我吗?
在另一个php文件中定义的数据库在开头用include语句调用。
代码如下:
<?php
// -----------------------------------------------------------
// INCLUSIONE FILE
// ----------------------------------------------------------------------
$GLOBALS['HomeDir']=substr($_SERVER['SCRIPT_FILENAME'], 0, strrpos($_SERVER['SCRIPT_FILENAME'], "")); //Rilevo Home directory
require_once "Include/Include.php"; //Inclusioni generali
if (isset($_GET["id"]) and isset($_GET["variabile"]) and isset($_GET["da"]) and isset($_GET["a"])){
$Nome="storico.csv";
header("Content-Type: application/text");
header("Content-Disposition: attachment; filename=".$Nome);
$Iden=$_GET["id"];
$Variab=$_GET["variabile"];
$Start=$_GET["da"];
$End=$_GET["a"];
if ($GLOBALS['Db']->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if (isset($GLOBALS['Db'])
$Database=$GLOBALS['Db']->get_results("SELECT DateTime, Value FROM ".RESTDATA." WHERE (UID = '".$Iden."' AND Field = '".$Variab."' AND DateTime >= '".UnixToMySQLTime($Start)."' AND DateTime <= '".UnixToMySQLTime($End)."' ORDER BY ID ASC;");
}
foreach ($Database as $Data){
print "'".gmdate("d/m H:i", MySQLToUnixTime($Data->DateTime))."';".$Data->Value."n"; //Scrivo in tabella dato
}
?>
答案 0 :(得分:0)
)
if
if (isset($GLOBALS['Db']))
$Database=$GLOBALS['Db']->get_results("SELECT DateTime, Value FROM ".RESTDATA." WHERE (UID = '".$Iden."' AND Field = '".$Variab."' AND DateTime >= '".UnixToMySQLTime($Start)."' AND DateTime <= '".UnixToMySQLTime($End)."' ORDER BY ID ASC;");
}