title: How do I stop my sql query from displaying the results twice?
body: <p>How do I stop the results from getting displayed twice on the web page? What have I done wrong? Yes this is for a game but it helps me learn SQL and PHP. Please be genital it's my first time.
  There is one database with two tables. The database is game_tittle the two tables are player_data and the second is character_data.</p>
  
  <pre><code>&lt;?php  
  include('db_conn.php');
  #for connecting to SQL
  $sqlget = "SELECT player_data.PlayerName, Character_data.Duration, character_data.KillsZ, character_data.KillsB, character_data.KillsH, character_data.HeadshotsZ, character_data.Humanity, character_data.Generation, character_data.InstanceID FROM player_data, character_data";
  $sqldata = mysqli_query($dbcon, $sqlget) or die('error getting data');
  echo "&lt;center&gt;&lt;table&gt;";
  echo "&lt;tr&gt; &lt;th&gt;Player Name&lt;/th&gt;&lt;th&gt;play time&lt;/th&gt;&lt;th&gt;Total Kills&lt;/th&gt;&lt;th&gt;Bandit kills&lt;/th&gt;&lt;th&gt;Hero Kills&lt;/th&gt;&lt;th&gt;Head shots&lt;/th&gt;&lt;th&gt;Humanity&lt;/th&gt;&lt;th&gt;Alive count&lt;/th&gt;&lt;th&gt;Instance ID&lt;/tr&gt;";
    while ($row = mysqli_fetch_array($sqldata)) {
  
      echo "&lt;tr&gt;&lt;td&gt;";
      echo $row['PlayerName'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['Duration'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['KillsZ'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['KillsB'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['KillsH'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['HeadshotsZ'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['Humanity'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['Generation'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['InstanceID'];
      echo "&lt;/td&gt;&lt;/tr&gt;";
      echo "&lt;/center&gt;";
      }
  
      echo "&lt;/table&gt;";
      #end of table
  
  
  
  ?&gt;
  </code></pre>
  
  <p>Got it to work this way.</p>
  
  <pre><code>&lt;?php  
  include('db_conn.php');
  $sqlget = "SELECT player_data.PlayerUID, character_data.PlayerUID, player_data.PlayerName, character_data.HeadshotsZ, character_data.KillsZ, character_data.KillsH, character_data.KillsB, character_data.Alive, character_data.Generation, character_data.Humanity, character_data.InstanceID FROM player_data INNER JOIN character_data ON player_data.PlayerUID = character_data.PlayerUID";
  $sqldata = mysqli_query($dbcon, $sqlget) or die('error getting data');
  echo "&lt;center&gt;&lt;table&gt;";
  echo "&lt;tr&gt; &lt;th&gt;Player Name&lt;/th&gt;&lt;th&gt;Head shots&lt;/th&gt;&lt;th&gt;Total Kills&lt;/th&gt;&lt;th&gt;Hero kills&lt;/th&gt;&lt;th&gt;Bandit Kills&lt;/th&gt;&lt;th&gt;Live or dead&lt;/th&gt;&lt;th&gt;Lifes&lt;/th&gt;&lt;th&gt;Humanity&lt;/th&gt;&lt;th&gt;Instance ID&lt;/tr&gt;";
    while ($row = mysqli_fetch_assoc($sqldata)) {
  
      echo "&lt;tr&gt;&lt;td&gt;";
      echo $row['PlayerName'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['HeadshotsZ'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['KillsZ'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['KillsH'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['KillsB'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['Alive'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['Generation'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['Humanity'];
      echo "&lt;/td&gt;&lt;td&gt;";
      echo $row['InstanceID'];
      echo "&lt;/td&gt;&lt;/tr&gt;";
      echo "&lt;/center&gt;";
      }
  
      echo "&lt;/table&gt;";
      #end of table
  
  
  
  ?&gt;
  </code></pre>