Whats the best field for an array?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Whats the best field for an array?

Post 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 :)
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post 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.
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post 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!
Post Reply