'invalid_id']); exit; } try { // Si tu utilises pf_holidays au lieu de pf_holidays_ideas, change le nom de la table ici ! $st = $pdo->prepare("SELECT * FROM pf_holidays_ideas WHERE id = ?"); $st->execute([$id]); $it = $st->fetch(PDO::FETCH_ASSOC); if (!$it) { http_response_code(404); echo json_encode(['error' => 'not_found']); exit; } $it['id'] = (int)$it['id']; if (isset($it['lat'])) $it['lat'] = (float)$it['lat']; if (isset($it['lng'])) $it['lng'] = (float)$it['lng']; if (isset($it['ideal_days'])) $it['ideal_days'] = (int)$it['ideal_days']; echo json_encode($it, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); } catch (Throwable $e) { http_response_code(500); echo json_encode(['error' => 'server_error']); }