Jump to content

[SOLVED] phpMyAdmin database normalization


SirChick

Recommended Posts

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    |

                                    +-----------+

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.

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.