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.
Suggested Database size?
Moderator: General Moderators
- Skoalbasher
- Forum Contributor
- Posts: 147
- Joined: Thu Feb 07, 2008 8:09 pm
Re: Suggested Database size?
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.
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.
- Skoalbasher
- Forum Contributor
- Posts: 147
- Joined: Thu Feb 07, 2008 8:09 pm
Re: Suggested Database size?
Cool beans! That's exactly how I have mine setup, just wanted to make sure I wasn't blowing a lot of space.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.
Re: Suggested Database size?
Why don't you use varchar(N) instead of char(N) ?Skoalbasher wrote:just wanted to make sure I wasn't blowing a lot of space.
There are 10 types of people in this world, those who understand binary and those who don't
- Skoalbasher
- Forum Contributor
- Posts: 147
- Joined: Thu Feb 07, 2008 8:09 pm
Re: Suggested Database size?
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?VladSun wrote:Why don't you use varchar(N) instead of char(N) ?Skoalbasher wrote:just wanted to make sure I wasn't blowing a lot of space.
That saves the space no?