PLANNING YOUR DATABASE ADDITION

Now that I’ve touched on the actual meat of the field, now you have to plan it. I suggest writing your plan down on a piece of paper or a notebook to keep things clear for yourself.

Name: First of all, what do you want to call your field? Keep it short, simple, and descriptive. (Do you really want to type out “usercontactinformation” everytime you call that field?) If you’re adding a contact link that has a short nick-name or a popular acronym, go ahead and use it. It doesn’t matter what case your name is in, just so long as you’re going to remember it’s in upper case, lower case, or mixed case when you go to write it. I usually do all mine in lower case to make it easier for me to remember.

Datatype: First ask yourself what kind of information you want that field to store.

Stuff like links, instant messenger names, contact information, user names for other sites could safely be stored in the VARCHAR datatype.

Notes, extra bios, and other things that could contain a large amount of data should be stored in the TEXT datatype.

Things like “yes” or “no” answers can be further simplified to “0″ for “no” and “1″ for “yes.” Additions that offer multiple options like my gender mod or JanAQ’s affiliation mod can also be shortened to numbers. You can store these in a short datatype, like CHAR or TINYINT.

Length: How much information do you need to store?

If you’re storing only a single character or number in that field, you can safely make the length 1.

If you’re allowing them to put in their user name from another archive or another Instant Messenger screen name, you should probably make it long enough to store the largest name allowed for that medium. Usually 200 to 255 characters are plenty.

Null or Not Null: As I said above, most of the fields in your eFiction database usually don’t accept null values so we’ll just say “No.”

Where (After): If you’re doing this by hand, you might also want to determine where you want the field to be. By “where”, I mean what field do you want the new one to come after? Knowing where your field is placed is very important and I’ll discuss why in a moment.

You can leave a response, or trackback from your own site.

Leave a Reply