creating a DB
hey...i need some help, i created a db in MySQl, but i cant figure out how to name the fields and whatnot...i'm using phpMyAdmin...both are text fields...can you give me the specs i need please? thanks
hey...i need some help, i created a db in MySQl, but i cant figure out how to name the fields and whatnot...i'm using phpMyAdmin...both are text fields...can you give me the specs i need please? thanks
mairving posted this at 12:09 — 8th April 2003.
They have: 2,256 posts
Joined: Feb 2001
How to name the fields? I think everyone has different methods. I usually name them by the tablename_fieldname. An id field would be tablename_id.
Is this what you are talking about or are you also talking about what type of field, text, varchar, date, int, etc, to name them. Anything greater than 255 characters should be a text field. Some common mistakes are making fields like phone numbers and zip codes int fields. This doesn't work if you try to put the - in phone or zip fields.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
kb posted this at 15:26 — 8th April 2003.
He has: 1,380 posts
Joined: Feb 2002
everything...i dont know what type or how to name...like i put in "name" as the name for the first one, and it said it wasnt acceptable...
they are plain text...2 fields: 1 name, 1 email address...i want each different entry to add itself to the db, and not overwrite the previous ones...so what are the different things i need to change for each field...thanks
Busy posted this at 23:59 — 8th April 2003.
He has: 6,151 posts
Joined: May 2001
u_id - small int 4 auto increment primary index (adds to bottom of list) 4 can go up to 9999 if you want more make it 5 or 6
u_name - varchar 15 (not many names are longer than 15 but can be whatever)
u_email - varchar 20 (agin not many over 20 but can be anything)
there are some reserved words so if it says something like it wasn't acceptable add a extra letter or underscore.
many ways to do it
nuk3 posted this at 08:52 — 9th April 2003.
They have: 238 posts
Joined: May 2002
While this topic is here, what is null, not-null, varchar, int and all this other stuff? What exactly does each one mean? Thanks..
mairving posted this at 12:00 — 9th April 2003.
They have: 2,256 posts
Joined: Feb 2001
Varchar is a variable character field. Which means that the field can contain letters and/or numbers and it is variable in size so it saves some database space.
Char is similar except that it doesn't save database space.
Int is for Integer or a whole number.
Null means that the field doesn't have to have a value.
Not Null means that the field must contain a value.
Here is a whole list of column types.
Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states
kb posted this at 15:40 — 9th April 2003.
He has: 1,380 posts
Joined: Feb 2002
i figured it out...thanks
nuk3 posted this at 05:49 — 10th April 2003.
They have: 238 posts
Joined: May 2002
Thanks for that
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.