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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Updating MySql field from textarea 1

Status
Not open for further replies.

melrse

Programmer
Dec 13, 2000
25
US
It looks like the max length of a field be it Varchar or char is 255. This means that when I update the field from textarea, I will only get the first 255 characters. Has anyone found a work around on this?
 
Use a different column type in your table definition. You can use BLOB or TEXT (they're interchangeable) to extend the character limit. You can prefix either of these to better define the max number of characters as follows:

TINY gets you 2^8
[no prefix] gets you 2^16
MEDIUM gets you 2^24
LONG gets you 2^32

Subtract 1 from any of the above and you have your limit.
So, TINYTEXT would result in a 255 character max.

Hope this helps,

brendanc@icehouse.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top