what datatype i should take?

Posted on 2009-07-06
Last Modified: 2012-05-07
when we take input type=text and in the database we have the datatype varchar , then we are able to access the value. if i take a textarea then what datatype i should take in the database??
Question by:designersx
  • 2
LVL 34

Expert Comment

by:Beverley Portlock
ID: 24784942
For a textarea use data type TEXT. This will allow you to have up to 64K of data in the field. If you need more than this then look at MEDIUMTEXT.

TEXT fields are not as indexable as VARCHAR fields.

Author Comment

ID: 24784993
thanks for the above post.

sir tell me 1 thing , in textarea can we write any amount of data??
if suppose i take datatype to be longtext then textarea would work or not?? please tell me
LVL 34

Accepted Solution

Beverley Portlock earned 125 total points
ID: 24785068
"sir tell me 1 thing , in textarea can we write any amount of data??"

No. There are limits.

TEXT => 64K maximum
MEDIUMTEXT => 16M maximum
LONGTEXT => 2GB maximum

"if suppose i take datatype to be longtext then textarea would work or not?? please tell me"

It should work OK, but your PHP installation may have a POST limit of 8M (which is not uncommon). You can change this by checking php.ini and looking for POST_MAX_SIZE

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question