title: Getting Team Members In a Specific Team in MySQL
body: <p>I have this Teams table (can be a Projects Table as well) and Members table</p>
  
  <pre><code>+-----------+--------------+------+-----+---------+----------------+
  | Field     | Type         | Null | Key | Default | Extra          |
  +-----------+--------------+------+-----+---------+----------------+
  | id        | int(11)      | NO   | PRI | NULL    | auto_increment |
  | team_name | varchar(100) | NO   | UNI | NULL    |                |
  | team_desc | varchar(200) | NO   |     | NULL    |                |
  | createdby | varchar(100) | NO   |     | NULL    |                |
  +-----------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>and Members table</p>
  
  <pre><code>+-------------+--------------+------+-----+---------+----------------+
  | Field       | Type         | Null | Key | Default | Extra          |
  +-------------+--------------+------+-----+---------+----------------+
  | id          | int(11)      | NO   | PRI | NULL    | auto_increment |
  | firstname   | varchar(45)  | NO   |     | NULL    |                |
  | lastname    | varchar(45)  | NO   |     | NULL    |                |
  | address     | varchar(200) | NO   |     | NULL    |                |
  | city        | varchar(45)  | NO   |     | NULL    |                |
  | state       | varchar(45)  | NO   |     | NULL    |                |
  | country     | varchar(45)  | NO   |     | NULL    |                |
  | email       | varchar(45)  | NO   |     | NULL    |                |
  | phone       | varchar(10)  | YES  |     | NULL    |                |
  | experience  | varchar(45)  | NO   |     | NULL    |                |
  | designation | varchar(45)  | NO   |     | NULL    |                |
  | username    | varchar(45)  | NO   |     | NULL    |                |
  | password    | varchar(45)  | NO   |     | NULL    |                |
  +-------------+--------------+------+-----+---------+----------------+
  </code></pre>
  
  <p>and these two tables are joined by this teams_members table,</p>
  
  <pre><code>+------------------+---------+------+-----+---------+----------------+
  | Field            | Type    | Null | Key | Default | Extra          |
  +------------------+---------+------+-----+---------+----------------+
  | teams_members_id | int(11) | NO   | PRI | NULL    | auto_increment |
  | teams_id         | int(11) | NO   | MUL | NULL    |                |
  | members_id       | int(11) | NO   | MUL | NULL    |                |
  +------------------+---------+------+-----+---------+----------------+
  </code></pre>
  
  <p>What I want to do is get members in a specific team. I am quite confused how I am gonna do this (may be I am dumb :P)</p>
  
  <pre><code>SELECT * 
  FROM teams_members tm, members m, teams t 
  WHERE tm.members_member_id = m.id 
  AND t.team_name='team name can be anything'
  AND tm.id = t.id
  </code></pre>
  
  <p>It returns 0 results. Where I might be wrong?</p>