I was wondering if you where to have an article or articles with huge amounts of text, what would be better when creating the database structure for the articles text? And why?
What will be the advantages or disadvantages if any?.
I was thinking of using one of the data types below to hold the articles text for the MySQL database.
VARCHAR
TEXT
MEDIUMTEXT
LONGTEXT
解决方案
Please have a look at the Documentation of MySQL, there're the differences between these types explained.
But to answer your question, VARCHAR is a field of user-defined length, while the Text-Fields have a system-defined size:
VarChar [1-whatever (max at 65535)]
TinyText 255 (2^8 - 1)
Text 65535 (2^16 - 1)
MediumText 16M (2^24 - 1)
LongText 4G (2^32 - 1)
So, I use VarChar whenever I need a field which is smaller then 255.