title: Trying to DELETE from INNER JOIN (MYSQL via PHP) WHERE the joined table has the value I want to key off?
body: <p>I have two tables in MYSQL:</p>
  
  <pre><code>Encounters  
  +----+--------+------------+
  | Id | GameId | LocationId |
  +----+--------+------------+
  | 1  | 5      |     10     |
  | 2  | 5      |     12     |
  | 3  | 5      |     45     |
  +----+--------+------------+
  EncounterCards  
  +----+-------------+--------+
  | Id | EncounterId | CardId |
  +----+-------------+--------+
  |  6 | 1           | 26     |
  |  7 | 2           |  5     |
  |  8 | 3           |  5     |
  +----+-------------+--------+
  </code></pre>
  
  <p>I'm trying to join the two tables and delete all of the records in the <code>EncounterCards</code> table where the <code>GameId = 5</code>. When I do an inner join, it doesn't seem to let me do this because it's looking for the <code>GameId</code> column in the <code>EncounterCards</code> table, but it's only in the Encounters table.</p>
  
  <p>So in this use case, it would delete ALL records from the <code>EncounterCards</code> table.</p>
  
  <p>Here is my query:</p>
  
  <pre><code>`$query = "DELETE FROM EncounterCards INNER JOIN Encounters ON Encounters.Id = EncounterCards.EncounterId WHERE Encounters.GameId = {$game_id}";`
  </code></pre>