What structure type do I use for HTML content (MySQL)

后端 未结 4 1910
情深已故
情深已故 2020-12-10 04:03

I want to put a minified string of HTML into a database row - bare in mind it could be pretty large string, what kind of structure type do I use out of the following:

<
相关标签:
4条回答
  • 2020-12-10 04:39

    I would use TEXT. What are the options you were thinking about?

    0 讨论(0)
  • 2020-12-10 04:42

    I think that tinytext is ok if you page is not too long ! ?

    0 讨论(0)
  • 2020-12-10 04:52

    Text. Which one of them depends on the size of the HTML content you're planing to store

    0 讨论(0)
  • 2020-12-10 05:03

    LONGTEXT is probably excessive -- it allows data sizes up to 4GB.

    MEDIUMTEXT allows 16MB.

    TEXT allows 64KB.

    TINYTEXT allows only 255 characters.

    Very few HTML documents are going to be 64KB in size, so a TEXT ought to be suitable for you. If you really want to be safe, go for a MEDIUMTEXT.

    Reference: http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html

    0 讨论(0)
提交回复
热议问题