更新用户注销无法正常工作的时间戳[重复]

function logout() 
{

$session_ida = $_SESSION['user']['name'];

$query3 = "UPDATE 'userlog' set 'logout' = CURTIME() where username = 
        '$session_ida'";

mysqli_query($db,$query3);

unset($_SESSION['user']['name']);

session_destroy();

header("location: login.php");

}
</div>

You haven't defined the variable $db yet. I'll bet that you defined it in a different scope - however, as this is a separate function, this variable isn't directly accessible.