3

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?

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>?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Tauciokas
  • 101
  • 1
  • 1
  • 13
  • Storage engine has nothing to do with styling the content. Text vs Blob: http://stackoverflow.com/questions/7071662/mysql-text-vs-blob-vs-clob – Mike B Apr 09 '14 at 19:53

1 Answers1

3

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.

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
  • Thanks for your answer. So if I decide to use TEXT can I use the likes of

    or

    to style the text? If I'm inserting text to the database can I insert it something like this?

    Article title

    Paragraph

    – Tauciokas Apr 09 '14 at 19:59
  • Yes, that's perfectly possible. – GolezTrol Apr 09 '14 at 19:59
  • Perfect. One last thing. What type of storage engine should I pick ? If that effects anything. Sorry for all these silly questions – Tauciokas Apr 09 '14 at 20:00
  • It also depends. If you pick `TEXT` and you use `MyISAM` as a storage engine, you can use `FULLTEXT` indices to search the texts in a faster and more flexible way than using `LIKE`. – GolezTrol Apr 09 '14 at 20:04
  • 2
    @TonyS You could use those tags in a blob field as well... You literally could not spot the difference if I showed you an article that was stored in text vs blob. – Mike B Apr 09 '14 at 20:11