I am getting the above error when I run this page on a linux server, but it doesn't give me any errors when running it on a windows machine. The following is my script:
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
}
Please assist