Page 1 of 1

Textfield Database Storage!

Posted: Fri Feb 20, 2004 11:18 pm
by bumple
Hey all,

I was wondering, for a web site that wants to store about seven fields, all containing 1,000 characters each, what type of variable (TEXT, LONGTEXT?) would I use with MySQL? For example, what does this forum use?

Thanks!
-BUMPle.

Posted: Sat Feb 21, 2004 4:12 am
by Dale
LONGTEXT, because TEXT only allows 255 characters and when adding a LONGTEXT field to MySQL (if your using that) you dont need to enter a value for it :)

Posted: Sat Feb 21, 2004 11:39 am
by evilMind
Correction a "TEXT" field allows 2^16 - 1 characters (65535... as does BLOB)
TINYTEXT allows only 2^8 - 1 (255) characters.
LONGTEXT allows 2^32 - 1 (approx 4G or 4294967295)

see http://www.mysql.com/doc/en/Column_types.html for more information.

So, my answer would be TEXT not LONGTEXT ( LONGTEXT can make the db slower )