title: MySQL inner join 2 tables to match user number to user name
body: <p>I'm sorry this has probably been answered hundreds of time but I'm totally lost between different scenarios here.</p>
  
  <p>What I want is pretty simple.  I have 2 tables "bets" and "users".</p>
  
  <p>In the table "bets", I put the UserID instead of the UserName.  In the table "users", the UserName is linked to the UserID.</p>
  
  <p>I would like to be able to read the data from the table "bets" and display the UserName instead of the UserID, so I will need some sort of code to match the UserID contained in the table "bets" and return the UserName instead.</p>
  
  <p>The MySQL query I have for now:</p>
  
  <pre><code>$sql5="SELECT * FROM Bets, Users WHERE GameID = '$NGnumber' ORDER BY DrawOrder";
  $result5 = mysql_query($sql5) or die(mysql_error());
  while($rows5 = mysql_fetch_assoc($result5)){
  ...
  </code></pre>
  
  <p>I can easily echo <code>$rows5['UserID']</code> but I would like the UserName (in the Users table) instead.  How can I do that?</p>
  
  <p>Thanks!</p>