// Log login activity
$ipAddress = $_SERVER['REMOTE_ADDR'];
$userAgent = $_SERVER['HTTP_USER_AGENT'];
$logStmt = $this->conn->prepare("
INSERT INTO login_activity (user_id, ip_address, user_agent)
VALUES (?, ?, ?)
");
$logStmt->bind_param("iss", $res['id'], $ipAddress, $userAgent);
$logStmt->execute();