Hi all
I'm having a hard time selecting data from my database. What I want to do is when I view the page that allows me to edit a team name (team1 for instance) I want to list all the product types and then check the checkboxes of the product types that are currently associated with the team (eg team1).
My tables are as follows:
Table teams
*------------*
| id | team |
|------------|
| 1 | team1 |
| 2 | team2 |
*------------*
Table product_types
*--------------------*
| id | product_type |
|--------------------|
| 1 | bangle |
| 2 | necklace |
| 3 | ring |
| 4 | men's rings |
| 5 | women's rings |
*--------------------*
Table teams_types (products associated with each team)
*--------------------------*
| id | product_type | team |
|--------------------------|
| 1 | 1 | 1 |
| 2 | 2 | 1 |
| 3 | 3 | 1 |
| 4 | 4 | 1 |
| 5 | 2 | 2 |
| 6 | 4 | 2 |
*--------------------------*
I'd appreciate any help. Any attempts at using a join statement have been a failure.