<?php
require_once __DIR__ . '/../../engine/engine.php';

$symbol = $_GET['symbol'] ?? '';

if (!$symbol) {
	http_response_code(400);
	exit('Fehlender Parameter.');
}

// Nehme die zuletzt gespeicherte Notiz
$stmt = $pdo->prepare("SELECT note FROM watchlist WHERE symbol = ? ORDER BY id DESC LIMIT 1");
$stmt->execute([$symbol]);
$note = $stmt->fetchColumn();

echo htmlspecialchars($note ?: '');
