以MYSQL数据类型存储文章

时间:2022-06-01 16:50:58

I'm doing this test project of my own. I'm new to web development and need a little advice. I know to store articles you need to use TEXT or some people use BLOB. Which is better?

我正在做我自己的测试项目。我是web开发新手,需要一点建议。我知道要存储文章你需要使用文本或者一些人使用BLOB。哪个更好?

Also, in order to properly style articles, what can I do? Change Storage engine? Maybe there is one that interprets HTML? Like paragraphs <p> and headers <h1>. Maybe even <br>?

另外,为了正确地设计文章的样式,我可以做什么?改变存储引擎?也许有一个解释HTML的?类似段落

,页眉

。甚至< br > ?

1 个解决方案

#1


2  

It depends on the format of the document. If it is HTML, RTF or Plain text, you can use TEXT. For Word documents, PDF's and other binary formats, use BLOB. When mixing the two, use BLOB as well. BLOBS can contain text data, but TEXT might not handle all binary data correctly.

这取决于文档的格式。如果是HTML、RTF或纯文本,可以使用text。对于Word文档、PDF格式和其他二进制格式,请使用BLOB。混合两者时,也要使用BLOB。BLOBS可以包含文本数据,但是文本可能不能正确地处理所有二进制数据。

#1


2  

It depends on the format of the document. If it is HTML, RTF or Plain text, you can use TEXT. For Word documents, PDF's and other binary formats, use BLOB. When mixing the two, use BLOB as well. BLOBS can contain text data, but TEXT might not handle all binary data correctly.

这取决于文档的格式。如果是HTML、RTF或纯文本,可以使用text。对于Word文档、PDF格式和其他二进制格式,请使用BLOB。混合两者时,也要使用BLOB。BLOBS可以包含文本数据,但是文本可能不能正确地处理所有二进制数据。