# Need help with relation Database

**URL:** <https://forum.kirupa.com/t/need-help-with-relation-database/245284>\
**Category:** programming\
**Created:** [November 28, 2007, 8:34am UTC](https://forum.kirupa.com/t/need-help-with-relation-database/245284 "2007-11-28T08:34:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![koolkrasher](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@koolkrasher](https://forum.kirupa.com/u/koolkrasher)\
**Post date:** [November 28, 2007, 8:34am UTC](https://forum.kirupa.com/t/need-help-with-relation-database/245284/1 "2007-11-28T08:34:49Z")

</div>

Hello again everyone. I am trying to join 3 db’s together so i can echo out 1 string containing team name, player name and position.

Tables are set up as follows

## team team\_id (Pk) auto ++ name

## position position\_id (Pk) auto ++ position\_name

## players player\_id (Pk) auto ++ team\_id position\_id name

i tryed an sqlquery in phpMyAdmin but no luck

```
                            SELECT * FROM team, positions, players
                            WHERE team.team_id = 1

```

[COLOR=Red] AND team.team\_id = players.team\_id(error on this line)[/COLOR]  
AND players.position =players.position \_id

Anyone have any idea if im doing this correctly?
