如何在 Postgresql 数据库表字段中存储 HTML 代码? [英] How can I store HTML code in a Postgresql DB table field?
问题描述
我得到了一个大型且变化多端的动态 XML 数据提要(200 多个类别和 3500 多个产品,大小为 11 MB 以上)来 CRUD 我的数据库.问题是,长描述字段中嵌入了 HTML 代码(例如,视频和播放器设置的链接以及页面布局.是的,我知道,编程不-应该用 CSS 完成-但它就在那里无论如何.创建数据库表时 HTML 不是一个选项.我在 WAPP 堆栈上使用 PHP 和 PostgreSQL.我该如何解决这个问题?
I get a large and vary dynamic XML data feed (200+ categories and 3500+ products that is 11+ MB) to CRUD my DB. The problem is, there is HTML code embedded in the long description field (.e.g. links to a video and player settings as well as page layout. YES, I know, a programming no no - should be done with CSS - but it is there anyhow. When creating the database table HTML is not an option. I am using PHP and PostgreSQL on a WAPP stack. How can I get around this problem?
推荐答案
您可以尝试使用 TEXT
字段并将 HTML
转储到那里.
You could try using a TEXT
field and dump the HTML
there.
此外,PostgreSQL
具有内置的自动压缩用于TEXT
字段!
Additionally, PostgreSQL
has in-built automatic compression for TEXT
fields!
这篇关于如何在 Postgresql 数据库表字段中存储 HTML 代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!