Here is what I have:
Tables:
color
design
font
font_color
items
I need to link color, design, font, and font_color to items but each item will have a different colors, designs, fonts, and font_colors and different amouts of each. I know how to use Mysql joins.
Anyone have a idea on how I would go about making a db for this?
Mysql Linking help
Moderator: General Moderators
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
Ok I will try to explain it better:fractalvibes wrote:What are the columns for these tables and how do they relate to each other? What are you trying to do in this application? Once we know that, am sure the answer will be easy enough...
fv
I have Items in a Items table each item will have mulitple and different colors, designs, fonts, and font_colors. I need to find a way to put them together.
The only way I have thought of is to add a field for each one:
example:
id / red / blue / green
1 / 1 / 0 / 1
2 / 0 / 0 / 1
And doing that on ward with desings fonts ect. But that would add up to 70 or more fields and add alot of unwanted bloat.
-
fractalvibes
- Forum Contributor
- Posts: 335
- Joined: Thu Sep 26, 2002 6:14 pm
- Location: Waco, Texas
Ok so basically you need to represent entities known as Items, which can have multiple attributes.
color
design
font
font_color
These above can become Domain tables:
Color_table
ID
ColorName
Font_Table
ID
FontName
etc.
Then your Item table can have:
Item_Table
ID
ItemName
ItemDescription
ColorID
FontId
DesignID
FontColorID
etc.
Populate your domain tables with the range appropriate to each.
fv
items
color
design
font
font_color
These above can become Domain tables:
Color_table
ID
ColorName
Font_Table
ID
FontName
etc.
Then your Item table can have:
Item_Table
ID
ItemName
ItemDescription
ColorID
FontId
DesignID
FontColorID
etc.
Populate your domain tables with the range appropriate to each.
fv
items