Jump to content

Choosing data types in MySQL


danielkraus

Recommended Posts

I am curious to the differences in char and varchar. I don't really know what the difference is, the material I have read is some what vague, or I just don't get it.Also I need to store some fairly large chunks of content, 300-700 words a piece. I thought I would use the LONGTEXT data type, but then read about blobs and was confused as to which would work better. This information will be pulled form the database and then presented into html via php. I am just starting MySQL and php and just need a little guidance and direction. Thanx.

Link to comment
Share on other sites

I am curious to the differences in char and varchar.
The CHAR and VARCHAR types are declared with a length that indicates the maximum number of characters you want to store. For example, CHAR(30) can hold up to 30 characters.The length of a CHAR column is fixed to the length that you declare when you create the table. The length can be any value from 0 to 255. When CHAR values are stored, they are right-padded with spaces to the specified length. When CHAR values are retrieved, trailing spaces are removed.
http://dev.mysql.com/doc/refman/5.0/en/char.htmlHope that cures your curiosity :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...