DB Design

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsDatabasesDB Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old July 28th, 2008, 03:51 PM
Draygon Draygon is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jul 2008
Posts: 1 Draygon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 30 m 26 sec
Reputation Power: 0
Database Design Help

I am not a expert in sql or php and I took this project on with some knowledge of both. I am having some trouble designing a database for a campaign I am working on for a game (a mod to a mod basically). In this database I have 5 columns for the users table. I have am thinking of creating it like this:

Code:
CREATE TABLE users ('user_id' INT() NOT NULL AUTO_INCREMENT, 'profile_name) CHAR(16) NOT NULL, 'faction' ENUM ('allies','axis') NOT NULL, 'doctrine' CHAR(15) NOT NULL, 'division' CHAR(15), PRIMARY KEY ('user_id'))


Now there are a few problems with that, and thats why I am asking for help here. Specifically the doctrine and division columns are what I am having a problem with. Each of the (doctrine and division) actually have a set number of choices to choose from (there are only 6 doctrines (3 for each faction (axis, allies)) and there are 12 divisions to choose from (6 per faction).

Someone suggested to me that I should create 2 seperate tables for the doctrines and the divisions (and have each doctrine and division have their own unique ID) and have them be foreign keys and tie them into the users table. I dont know how to do this, or how I would use the table in this way.

This will all be used for a form where it asks the user for the name they want to use during the campaign (profile_name) and they choose their faction (axis, allies) once they choose the faction it will then display the doctrines and division for that faction that they can choose from (they can make 3 choices (3 doctrine, 3 division) and once they do that they hit register it will then do some checks and then insert the information into the table that I set up.

I appreciate any help that is offered or any suggestions that any of you may have.

Thanks,
Dray

Reply With Quote
Reply

Viewing: Tutorialized ForumsDatabasesDB Design > Database Design Help


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap