Page 1 of 1

Whats the best field for an array?

Posted: Thu Aug 15, 2002 5:36 pm
by JPlush76
In MYSQL is it best to store your arrays in a TEXT column type if your not sure on what total length could be?

IE: user gets to store their favorite bands

thanks :)

Posted: Thu Aug 15, 2002 6:09 pm
by hob_goblin
text would be the best for long things, varchar for things around 255 chars.

if you're storing arrays you should first use implode(), and then explode() it out of the db.

Posted: Thu Aug 15, 2002 6:13 pm
by JPlush76
yea thats what I'm doing , thanks to your post I found on here the other day :)

I finally got the damn hang of arrays, hehe

thanks again!