title: Why is it not saving on the database?
body: <p>I have an input form for a sample php.</p>
  
  <pre><code>&lt;form action="insert.php" method="post"&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;First Name:&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" id="fname" name="fname" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Last Name:&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" id="lname" name="lname" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Age:&lt;/td&gt;
                  &lt;td&gt;&lt;input type="text" id="age" name="age" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;td&gt;&lt;input type="submit" value="Add Person!" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>and the insert.php goes like this</p>
  
  <pre><code>&lt;?php
      $host = "localhost";
      $user = "root";
      $pass = "";
      $con = mysql_connect($host, $user, $pass);
      $db = "phptest";    
  
      if(!$con)
      {
          die("Could not connect: " . mysql_error());
      }
      mysql_select_db($db,$con);
      $sql = "INSERT INTO persons (FirstName,LastName,Age) VALUES ('$_POST[fname]','$_POST[lname]','$_POST[age]')";
      mysql_query($sql,$con);
      mysql_close($con);
  ?&gt;
  </code></pre>
  
  <p>It works fine for the first input. When I input another values and press the submit button, the data is not saving into the database. In the database, it only shows 1 row filled with my first input. What's the problem on the code for insert.php? Thanks.</p>