Page 1 of 1

Linking Tables using PHP

Posted: Thu Mar 12, 2009 11:44 am
by nishmgopal
Hi Guys

I am researchin on the internet about how to define relationships between tables using php?

Basically I have say:

Job Table:

ID Name
---------
1 Manager
2 Developer
3 Analyst

Skill Table:

ID Name
----------
1 Java
2 C
3 C#

And I want to create the following table:

Job ID Skill ID
-------------
1 2
1 3
1 1
2 1
2 2

So by referencing the ID, I want to display the corresponding names so according to table above, the jod id 1 refers to manager and to do this job you need Java, C and C#.

Is this possible?

Thank you.

Re: Linking Tables using PHP

Posted: Thu Mar 12, 2009 12:17 pm
by jayshields
You need to use joins, or you could get away with doing it with a simple SELECT query.

Search around for many-to-many relationships and SQL, it's nothing to do with PHP.