prepare("SELECT foto_producto FROM marketing_videos WHERE id = ?"); $stmt->execute([$id]); $video = $stmt->fetch(PDO::FETCH_ASSOC); if ($video) { if (!empty($video['foto_producto']) && file_exists($video['foto_producto'])) { unlink($video['foto_producto']); } $stmt = $db->prepare("DELETE FROM marketing_videos WHERE id = ?"); $stmt->execute([$id]); } } $redirect = $_GET['redirect'] ?? 'marketing_produccion.php?success=1'; header("Location: " . $redirect); exit;