title: MySQL seems to be overwriting records
body: <p>I have a brand new table in MySQL that can be described as such:</p>
  
  <pre><code>+-----------+----------+-------+------+-----+-------+
  |   Team    |   Match  |  Auto | Gear | Kpa | Climb |
  +-----------+----------+-------+------+-----+-------+
  |   1721    |     1    |   3   |  5   |  5  |   1   |
  +-----------+----------+-------+------+-----+-------+
  |   5813    |     2    |   2   |  2   | 15  |   0   |
  +-----------+----------+-------+------+-----+-------+
  </code></pre>
  
  <p>When I try to make a new entry into the table with the following syntax</p>
  
  <pre><code>INSERT INTO 2017marea (Team, `Match`, Auto, Gear, Kpa, Climb) VALUES ('1721', '19', '3', '5`, `15`, `1`);
  </code></pre>
  
  <p>and then I print the table again I can only see 1721's newest record, not their older one. I tried adding a fourth column with an auto increment primary key but it still kept the same behavior.</p>
  
  <p>How do I stop it from overwriting old data while writing new data to the database?</p>
  
  <p><strong>Edit for clarity:</strong> Here's what the new table would look like after the insert command.</p>
  
  <pre><code>+-----------+----------+-------+------+-----+-------+
  |   Team    |   Match  |  Auto | Gear | Kpa | Climb |
  +-----------+----------+-------+------+-----+-------+
  |   5813    |     2    |   2   |  2   | 15  |   0   |
  +-----------+----------+-------+------+-----+-------+
  |   1721    |    19    |   3   |  5   | 15  |   1   |
  +-----------+----------+-------+------+-----+-------+
  </code></pre>
  
  <p><strong>Edit:</strong> function used to create the table:</p>
  
  <pre><code>CREATE TABLE `2017marea` (`Team` INT(25) NOT NULL, `Match` INT(25) NOT NULL, `Auto` TINYINT(2) NOT NULL, `Gear` TINYINT(2) NOT NULL, `Kpa` TINYINT(2) NOT NULL, `Climb` TINYINT(2) NOT NULL);
  </code></pre>
  
  <p><strong>More edits:</strong> It's <code>mysql_</code> via the <code>mysqli_</code> shim (yes. I know. I am aware. It's never leaving a local network).</p>
  
  <p><strong>OK. This has become a PHP problem.</strong></p>
  
  <p>I can no longer get the issue to reproduce in the MySQL console. I have isolated the issue down to my PHP code. I'm still not sure what the issue is - <code>insert ignore</code> doesn't work either.</p>
  
  <p><strong>More edits, oh boy.</strong> This is a copy of my entire PHP logic. The database I provided here for an example is different (not as large of a table) as the actual, so the PHP code is slightly different. At any rate, here it is:</p>
  
  <pre><code>if (isset($_POST['team']) &amp;&amp; isset($_POST['match']) &amp;&amp; isset($_POST['auto']) &amp;&amp; isset($_POST['gear']) &amp;&amp; isset($_POST['kpa']) &amp;&amp; isset($_POST['climb'])) {
      $team = mysql_real_escape_string($_POST['team']);
      $match = mysql_real_escape_string($_POST['match']);
      $auto = mysql_real_escape_string($_POST['auto']);
      $gear = mysql_real_escape_string($_POST['gear']);
      $kpa = mysql_real_escape_string($_POST['kpa']);
      $climb = mysql_real_escape_string($_POST['climb']);
  
      $postQuery = mysql_query("INSERT INTO 2017marea (Team, `Match`, Auto, Gear, Kpa, Climb) VALUES ($team, $match, $auto, $gear, $kpa, $climb)") or die("MySQL Error: " . mysql_error());
      if ($postQuery) {
        echo "&lt;script&gt; window.location.replace('../scouting/index.php?s=1')&lt;/script&gt;";
      } else {
        echo "&lt;script&gt; window.location.replace('../scouting/index.php?f=1')&lt;/script&gt;";
      }
    } else {
      // This is an HTML form. Truncated for easy display.
    }
  </code></pre>