prepare("UPDATE inversiones SET fecha = ?, descripcion = ?, monto = ?, tipo = ? WHERE id = ?"); $stmt->execute([$fecha, $descripcion, $monto, $tipo, $id]); header('Location: inversiones_operativas.php?success=updated#section-' . $tipo); exit; } catch (PDOException $e) { header('Location: inversiones_operativas.php?error=db_error'); exit; } } else { header('Location: inversiones_operativas.php'); exit; } ?>