Forum Moderators: open

Message Too Old, No Replies

Datatypes, and length.

         

I Will Make It

7:58 pm on Mar 7, 2006 (gmt 0)

10+ Year Member



Hi, should articles be stored as VARCHAR, or TEXT?
My articles will be about 500-800 words.
And the length?

Varchar = 3992 characters?
Text = 65,535 characters?

Does this mean that I can store 65,535 letters in TEXT and 3992 letters using VARCHAR?

What's most used when you want to put articles into a DB?

txbakers

3:43 am on Mar 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



VARCHAR in mySQL has a 255 character limit. You will need TEXT if you want to store the entire article.

I Will Make It

11:16 am on Mar 8, 2006 (gmt 0)

10+ Year Member



ahh.. ok :) thank you

moltar

11:49 am on Mar 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Values in VARCHAR columns are variable-length strings. The length can be specified as a value from 0 to 255 before MySQL 5.0.3, and 0 to 65,535 in 5.0.3 and later versions. (The maximum effective length of a VARCHAR in MySQL 5.0.3 and later is determined by the maximum row size and the character set used. The maximum length overall is 65,532 bytes.)

txbakers

7:55 pm on Mar 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



oooh! that's nice. I didn't know that about 5.0.3. That's good to know.

But the VarChar is a fixed size ultimately