Field type for short strings with variable length

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
hayson1991
Forum Newbie
Posts: 14
Joined: Thu Mar 20, 2008 1:19 pm

Field type for short strings with variable length

Post by hayson1991 »

Is there a field type that can store short strings with variable length? I have strings like "", "_99E", or "883An". I don't know how long or short they will be, but I'm pretty sure it's not going to go over 10 characters.

Sorry, I'm very new to MySQL and also need some help finding documentation.

Thanks in advance. :)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Re: Field type for short strings with variable length

Post by superdezign »

CHAR(10) or VARCHAR(10) will suffice. You shouldn't worry too much about it . Database space is plentiful.
Post Reply