Page 1 of 1

Suggested Database size?

Posted: Tue Jan 20, 2009 2:47 pm
by Skoalbasher
Hi All, I usually look around here, hardly ever ask questions.

I'm working on a data base table for users.

Getting the standard information. Username, password, first name, last name, address, etc..
I'm using phpMyAdmin, and trying to determine how big I want each field. Like Length/Values.

What is a good suggested size for username, passwords, first name etc... fields. I would like to run as smooth as possible by not taking up a lot of unused space.

Thanks in advance.

Re: Suggested Database size?

Posted: Tue Jan 20, 2009 2:54 pm
by Burrito
I don't know of any 'standards' for those types of fields. I usually allow my users username and password lenghts of 50. For actual information (ie real names etc), you just need to make sure it's long enough to allow for what you'd guess is the longest value possible.

ie: For first and last names I usually allow for 150 each. That's probably waaaaaaaaay bigger than any real first or last names, but in my business, sometimes people put in company names etc for their 'real' names and it's better to have the space for it than to truncate the info or worse, have mysql throw an error on an insert.

Re: Suggested Database size?

Posted: Tue Jan 20, 2009 3:22 pm
by Skoalbasher
Burrito wrote:I don't know of any 'standards' for those types of fields. I usually allow my users username and password lenghts of 50. For actual information (ie real names etc), you just need to make sure it's long enough to allow for what you'd guess is the longest value possible.

ie: For first and last names I usually allow for 150 each. That's probably waaaaaaaaay bigger than any real first or last names, but in my business, sometimes people put in company names etc for their 'real' names and it's better to have the space for it than to truncate the info or worse, have mysql throw an error on an insert.
Cool beans! That's exactly how I have mine setup, just wanted to make sure I wasn't blowing a lot of space.

Re: Suggested Database size?

Posted: Tue Jan 20, 2009 4:31 pm
by VladSun
Skoalbasher wrote:just wanted to make sure I wasn't blowing a lot of space.
Why don't you use varchar(N) instead of char(N) ?

Re: Suggested Database size?

Posted: Tue Jan 20, 2009 5:06 pm
by Skoalbasher
VladSun wrote:
Skoalbasher wrote:just wanted to make sure I wasn't blowing a lot of space.
Why don't you use varchar(N) instead of char(N) ?
That's what I am using. Not a SQL expert, but I know a lot of commands, lol. So the Varchar will only make it as big as it is right? With a max of whatever you put in?

That saves the space no?