I'm creating a form for sending private messages and want to set the maxlength
value of a textarea appropriate to the max length of a text
field in my MySQL database table. How many characters can a type text field store?
If a lot, would I be able to specify length in the database text type field as I would with varchar?
Best Solution
See for maximum numbers: http://dev.mysql.com/doc/refman/5.0/en/storage-requirements.html
L is the number of bytes in your text field. So the maximum number of chars for text is 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 than 1 byte of space. For UTF-8 space consumption is between 1 to 4 bytes per char.