database - Maximum length for MySQL type text -


i'm creating form sending private messages , want set maxlength value of textarea appropriate max length of text field in mysql database table. how many characters can type text field store?

if lot, able specify length in database text type field varchar?

see maximum numbers: http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html

tinyblob, tinytext       l + 1 bytes, l < 2^8    (255 bytes) blob, text               l + 2 bytes, l < 2^16   (64 kibibytes) mediumblob, mediumtext   l + 3 bytes, l < 2^24   (16 mebibytes) longblob, longtext       l + 4 bytes, l < 2^32   (4 gibibytes) 

l number of bytes in text field. maximmum number of chars text 216-1 (using single-byte characters). means 65 535 chars(using single-byte characters).

utf-8/multibyte encoding: using multibyte encoding each character might consume more 1 byte of space. utf-8 space consumption between 1 4 bytes per char.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -