prepare("SELECT * FROM inversiones WHERE id = ?"); $stmt->execute([$id]); $inversion = $stmt->fetch(PDO::FETCH_ASSOC); if (!$inversion) { header('Location: inversiones_operativas.php?error=not_found'); exit; } } catch (PDOException $e) { die("Error al obtener los datos: " . $e->getMessage()); } ?>