title: Problem with query
body: <p>I've four tables:</p>
  
  <ul>
  <li>characters
  
  <ul>
  <li>guid</li>
  <li>name</li>
  <li>gender</li>
  <li>class</li>
  <li>race</li>
  <li>online</li>
  </ul></li>
  <li>character_arena_stats
  
  <ul>
  <li>guid</li>
  <li>personal_rating</li>
  <li>matchmaker_rating</li>
  </ul></li>
  <li>arena_team_member
  
  <ul>
  <li>arenateamid</li>
  <li>played_season</li>
  <li>played_week</li>
  <li>wons_season</li>
  <li>wons_week</li>
  </ul></li>
  <li>arena_team
  
  <ul>
  <li>arenateamid</li>
  <li>captain_guid</li>
  </ul></li>
  </ul>
  
  <p>and I need to get character details(race,class,name,gender,online) and team information(personal_rating,matchmaker_rating,played_season,played_week,wons_season,wons_week,captain_guid), but can't get it working. My query is:</p>
  
  <pre><code>$result=mysql_query("SELECT 
              c.guid,
              c.name,
              c.gender,
              c.class,
              c.online,
              c.race,
              atm.guid,
              atm.played_season,
              atm.played_week,
              atm.wons_season,
              atm.wons_week,
              atm.arenateamid,
              cas.personal_rating,
              cas.guid,
              cas.matchmaker_rating,
              at.arenateamid,
              at.captainguid
           FROM
           character_arena_stats cas,
           arena_team_member atm,
           characters c,
           arena_team at
           WHERE c.guid = cas.guid AND atm.arenateamid = ".$entry." AND at.arenateamid = ".$entry."");
  </code></pre>
  
  <p>It should return only members whose guid is equal to c.guid, cas.guid, atm,guid and those, whose atm.arenateamid is equal to at.arenateamid. Insted, it returns a lot of random members. </p>
  
  <p>Thanks and sorry for my english. </p>