Thank you again for your help, I read PHP for Dreamweaver 8
and it gave me a
leg up, and I did a few simple DB projects with simple tables
or multiple
tables with one to many relationships. Now I've taken on a
project that goes
beyond what was covered in that book and discover that I'm
lost. Thanks to
you I understand the relationship between the three tables
and logic of how
the data is structured.
Unfortunately, short of hand entering the data in MySQL I
haven't a clue as
to how to use on-line forms to add, edit or delete data that
applies
simultaneously to the three tables.
Could you give me a recommendation? Is there a book that will
get me there?
If not, I may just sub out this part of the project?
Jeff
"Jeff" <jeffs@NoSpamLamSam.com> wrote in message
news:epgd3m$drg$1@forums.macromedia.com...
> David, thank you for your guidance.
> I see how the lookup table will tie the other two other
tables together.
> But, in the team table, how do you tell which skills
each team member
> posses without the skill_1, skill_2, etc... rows?
>
> I think I might be out of my league with this one, maybe
I need to buy
> another one of your books.
>
> Jeff
>
>
> "David Powers" <david@example.com> wrote in
message
> news:epgb61$bqk$1@forums.macromedia.com...
>> Jeff wrote:
>>> I have a situation where the relationship
between to tables
>>> (team,skills) is many to many
>>>
>>> members of the team have many different skills
>>> skills can be performed by many different team
members
>>> not all skills can be performed by each team
member
>>
>> You need a lookup table to link the two:
>>
>> skills
>> skill_id (int)(primary_key)
>> skill_name (varchar)
>> skill_description (varchar)
>>
>> team
>> team_id (int)(primary_key)
>> member_name (varchar)
>> member_bio (varchar)
>>
>> indiv_skills
>> skill_id
>> team_id
>> primary key (skill_id, team_id)
>>
>> By making the skill_id and team_id a composite
primary key, you ensure
>> that each entry is unique.
>>
>> SELECT skill_name, skill_description, member_name,
member_bio
>> FROM skills, team, indiv_skills
>> WHERE skills.skill_id = indiv_skills.skill_id
>> AND team.team_id = indiv_skills.team_id
>>
>>>
>>> On individual php web page I will display a
skill and the team members
>>> with that skill
>>>
>>> I was thinking to build two tables:
>>>
>>> skills
>>> skill_id (int)(primary_key)
>>> skill_name (varchar)
>>> skill_description (varchar)
>>>
>>> team
>>> team_id (int)(primary_key)
>>> member_name (varchar)
>>> member_bio (varchar)
>>> skill_1 (boolean)
>>> skill_2 (boolean)
>>> skill_3 (boolean)
>>> skill_4 (boolean)
>>> skill_5 (boolean)
>>> skill_6 (boolean)
>>> skill_7 (boolean)
>>> skill_8 (boolean)
>>> skill_9 (boolean)
>>> skill_10 (boolean)
>>>
>>> Is there a better way to do this?
>>> On the same php page is it possible to display
data from two tables that
>>> do not share a foreign_key?
>>>
>>> Jeff
>>
>>
>> --
>> David Powers, Adobe Community Expert
>> Author, "Foundation PHP for Dreamweaver 8" (friends
of ED)
>> Author, "PHP Solutions" (friends of ED)
>>
http://foundationphp.com/
>
>