I am getting server error for this script. I am assuming the SQL is not correctly syntaxed but i have tried everything I could think of and researched thoroughly. I’m sure this is just a novice, naive mistake but any advice will be appreciated.
function updateLogout($userID) {
$success = false;
// Get current date-time in MySQL format
$nowTimeStamp = date("Y-m-d H:i:s");
$insertLogout_SQL = "UPDATE AccessLog SET";
$insertLogout_SQL .= " timeLogout='".$nowTimeStamp."'";
$insertLogout_SQL .= " WHERE userID='".$userID."'";
if (mysql_query($insertLogout_SQL)) {
$success = true;
} else {
$success = $insertLogout_SQL . "<br />" . mysql_error();
}
return $success;
}
Following on from @Matt’s answer:
Also, you should really be using
mysqli_query.