【发布时间】:2015-05-20 05:16:20
【问题描述】:
当我在 linux 服务器上运行此页面时出现上述错误,但在 windows 机器上运行它时并没有给我任何错误。 以下是我的脚本:
include_once '/../src/init.php';
$userid = $user_data['userid'];
$date = ('Y-m-d'); //get todays date from the server
$db = new mysqli('localhost', 'root', '', 'logfile');
if ($db->connect_error) {
$error = $db->connect_error;
} else {
$sql = "SELECT a.kiloLogid,a.travelDate,a.openning, a.closing, a.clientsName,a.timeIn,a.timeOut, a.destination,a.diff
FROM viewDailyDiff a
WHERE a.`userid` = $userid AND a.`travelDate` = '".$date."'";
$result = $db->query($sql);
if ($db->error) {
$error = $db->error;
}
}
function getRow($result)
{
return $result->fetch_assoc(); //the error is on this line
}
请帮忙
【问题讨论】:
-
getRow()的电话在哪里? -
getRow() 是一个函数。它是我上传的代码的一部分
-
是的,我可以看到。但是在你上传的代码中没有调用,那我们怎么知道失败时
$result的值是多少呢?