PDA

View Full Version : MySQL - large text area



Daniel Hollands
January 28th, 2001, 11:44
Hi there all, I have a questions relating to MySQL.

I'm setting up a database in MySQL, and i will be using PHP to pull the info out of it, to display on the page.

My questions is this, what type of variable should I use to story my main body text?

I'm not sure if it would be "text" or "blob" or if ever of these has any limits.

I need to know which type would be best to use for storing a lot of data and info in, any ideas?

Thanx guys (and gals)

Woofcat
January 28th, 2001, 13:34
Only difference between blob and text (assuming you're storing text and not binary info such as images, etc) is that in selects blob is case-sensitive and text isn't. If you never select on blob/text fields (which you generally shouldn't) it doesn't make any difference at all. I usually use text.

blob/text:
max 65535 characters

mediumblob/mediumtext:
max 16777215 characters

longblob/longtext:
max 4294967295 characters

Daniel Hollands
January 28th, 2001, 13:40
Thank you so much for the info, i've now gone and changed all my text's to longtext's

What could I do if I wanted to store more than 4294967295 characters?

not that I ever will, or think I will anyway.

Koolguy
January 28th, 2001, 17:47
Well you would be pretty much screwed but remember 4294967295 chacers is 4294967295 bytes or about 4GB. Are you really gonna store that much lol.

Daniel Hollands
January 28th, 2001, 19:34
Well, I was never planning on storing that much data, after all, I only have 70MB of space :)

I was just intrested :)