SirChick Posted August 14, 2007 Share Posted August 14, 2007 Not sure if this is the correct place to ask but does any one know where i can learn about this? Apparently my method of table desgin is poor lol ! I google'd around but i didn't find any on how to do one using phpMyAdmin which is kinda essential. Quote Link to comment Share on other sites More sharing options...
trq Posted August 14, 2007 Share Posted August 14, 2007 database normalization is a design technique, what client you use (ie phpmyadmin) makes little difference. Here is a nice tutorial. Quote Link to comment Share on other sites More sharing options...
im8kers Posted August 14, 2007 Share Posted August 14, 2007 The concept of normalizing your data tables is the same across most all databases. Here is a link that will be very helpful. http://www.asp.net/learn/sql-videos/video-106.aspx It is in MS SQL, but again, take the concept. It's very informative. Quote Link to comment Share on other sites More sharing options...
SirChick Posted August 14, 2007 Author Share Posted August 14, 2007 ok well basically it was cos what i did in a table was: Gang ID Member1 Member2 Member3 Member4 Member5 in its simplistic manner and was told its a poor method Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 14, 2007 Share Posted August 14, 2007 You'll want to create two tables, one is gangs and the second gang_members. In gangs you store all the available gangs. You then then link the members that belong to a specific gang by storing the gang_id for gang the member belongs to in the gang_members table. +--------------+ | gang table | +-----------+ +--------------+ | Members | | id -------------+ +-----------+ | name | | | id | +--------------+ | | username | +------ gang_id | +-----------+ Quote Link to comment Share on other sites More sharing options...
im8kers Posted August 14, 2007 Share Posted August 14, 2007 I think it should be created like: Table1 - GangID, Gang Name Table2 - MemberID, GangID, Member Name Quote Link to comment Share on other sites More sharing options...
SirChick Posted August 14, 2007 Author Share Posted August 14, 2007 But then say you can have like 30 memebers do you just do: member id1 member id2 etc? why is ID matched with gang_id ? instead of id and id? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 14, 2007 Share Posted August 14, 2007 the id in the gang table and members table will be unique as they are populated using auto_increment. We setup a gang_id in the members table to link the member to gang the member is part of. This is how it is how it is basically done. If you do not understand I would recommend you to read up on database normalization. Quote Link to comment Share on other sites More sharing options...
SirChick Posted August 14, 2007 Author Share Posted August 14, 2007 i do understand as i have done it in microsoft access during alevels but how to do it in a different language was my difficulty. which was why i thought it wasnt possible. microsoft access is simple GUI where as this time im guna have to hard code it just to add if your guna link to fields in 2 tables should they not be the same name? like: Gang_ID in gang and Gang_ID in the member table ? or should they have different names Quote Link to comment Share on other sites More sharing options...
im8kers Posted August 14, 2007 Share Posted August 14, 2007 Try to keep the same names. It helps you in the long run. Quote Link to comment Share on other sites More sharing options...
SirChick Posted August 14, 2007 Author Share Posted August 14, 2007 thankyou Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.