title: MySQL query won't update database
body: <p>I have a MySQL query that for some reason won't update the table it's supposed to.</p>
  
  <pre><code>mysql_query("INSERT INTO newsletteroptions (email, exists)
  VALUES (\"".$_POST['email']."\", \"".$_POST['exists']."\")");
  </code></pre>
  
  <p>I've checked over my code and I'm sure that that is the line that is causing errors because the line before it was working -- I went in and edited the information in the database and it still truncated the table (see below)</p>
  
  <p>I don't know why that snippet isn't working, because I copied it over from another document almost exactly the same that I created and tested, and it worked.</p>
  
  <p>I also checked to make sure I spelled the table and field names correctly, and they all are.</p>
  
  <p>This is the full code:</p>
  
  <pre><code>echo "
  &lt;form action=\"newsletterinfo.php?status=done\" method=\"post\" name=\"article\" target=\"_self\"&gt;
  &lt;a title=\"The email address the newsletter is sent from\"&gt;Newsletter email address:&lt;/a&gt;&lt;input type=\"email\" name=\"email\" value=\"".$email."\"&gt;&lt;br /&gt;
  &lt;label for=\"exists\"&gt;Activate newsletter?&lt;/label&gt; &lt;input type=\"checkbox\" id=\"exists\" name=\"exists\" value=\"true\" ".$checkyes."&gt;&lt;br /&gt;
  
  &lt;input name=\"\" type=\"submit\" value=\"Update\" /&gt;
  &lt;/form&gt;";
  }
  else
  {
  
  $con = mysql_connect("WITHHELD","WITHHELD","WITHHELD");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("newsdb", $con);
  
      //Add article to database
      mysql_query("TRUNCATE TABLE newsletteroptions");
      mysql_query("INSERT INTO newsletteroptions (email, exists)
      VALUES (\"".$_POST['email']."\", \"".$_POST['exists']."\")");
  
  mysql_close($con);
  }
  </code></pre>