prepare("UPDATE attendance SET logout_time = :logout_time WHERE id = :id"); $attendance_stmt->bindParam(':logout_time', $logout_time); $attendance_stmt->bindParam(':id', $_SESSION['attendance_id']); $attendance_stmt->execute(); } session_unset(); session_destroy(); header("Location: login.php"); exit();