Maximum allowed size in MySQL text box

I am doing a project where the user can publish text, I used TinyText.
I need to know how much user input should enter? I found out that TinyText allows you to enter only 255 characters from http://www.htmlite.com/mysql003.php
But if the user logs in, then he must be converted to amp and amp ... So, what should be the ideal size that you can enter from users for these fields / data types.

TINYTEXT
Text

The user can insert data, but can not edit! User can view other data!
Thus, viewing will be used mainly!

+7
source share
2 answers

Here you can find detailed information about the MySQL text type: http://dev.mysql.com/doc/refman/5.0/en/blob.html

+4
source

I don’t think that by replacing html objects and pasting them into your database, you can control the final length inserted into your tinytext.

I would choose 2 options.

  • Insert the raw data into the database and use htmlentities in the output.
  • Limit it to the maximum number of characters, but use a larger text type.

Depending on your application, I would choose one.

+1
source

All Articles