Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

column more than 255 char

Status
Not open for further replies.

k23

Programmer
Aug 13, 2004
10
HK
Hi all,

Is it possible to create a column for more than 255 char? I tried the "longtext" in the datatype but its character limit is 255. As i need to insert some paragraphs with few hundred of words, any idea how to solve this limitation?

Thanks.
 
In MySQL 5, a CHAR/VARCHAR field can be up to 65535 characters long. Before that, CHAR/VARCHAR fields are limited to 255 characters, so you would have to use a TEXT field, which allows up to 65536 characters (MEDIUMTEXT and LONGTEXT have higher limits - 2^24 and 2^32 respectively).
 
Something that might be helpful:

Strings:
- CHAR(M) ;stable M lenght
- VARCHAR(M) ;variable/adjustable lenght: limit=M
- TEXT
- BLOB

Numbers:
- INTEGER:
- TINYINT ;1 byte
- SMALLINT ;2 bytes
- INT or INTEGER ;4 bytes
- BIGINT ;8 bytes
- FLOATING POINT:
- SINGLE ;precision
- DOUBLE ;precision
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top