title: Option input in form not passing
body: <p>I am trying to use a form to fill my db. I use a table from the database to fill the options in the form and it works, but the value is not being passed through, I ran through my code and can't find a typo, is there an error I am not seeing?</p>
  
  <pre><code>&lt;?php
  require("db.php");
  ?&gt;
  &lt;html&gt;
     &lt;head&gt;
        &lt;title&gt;Insert a Record in MySQL Database&lt;/title&gt;
     &lt;/head&gt;
  
     &lt;body&gt;
        &lt;?php
           if(isset($_POST['insert']))
           {            
              $user_added = $_POST['user_added']; 
              $age_added = $_POST['age_added'];
  
              $insert_query = "INSERT INTO userList ";
              $insert_query .= "(user, Age) ";
              $insert_query .= "VALUES ";
              $insert_query .= "('$user_added', '$age_added')";
  
              $retval = mysqli_query($connection, $insert_query);
  
              if(!$retval )
              {
                   die ("The error is: " . mysqli_error($connection));
              }
              else
              {
              echo "Database Updated " . $age_added . " " . $user_added;
              }
           }
           else
           {
              ?&gt;
                 &lt;form method="post" action="&lt;?php $_PHP_SELF ?&gt;"&gt;
                    &lt;table width="400" border="0" cellspacing="1" cellpadding="2"&gt;
                       &lt;tr&gt;
                          &lt;td width="100"&gt;User to Add&lt;/td&gt;
                          &lt;td&gt;&lt;input name="user_added" type="text" id="user_added"&gt;&lt;/td&gt;
                       &lt;/tr&gt;
                       &lt;tr&gt;
                          &lt;td width="100"&gt;Age&lt;/td&gt;
                          &lt;td&gt;&lt;select name="age_added" id="age_added"&gt;
                          &lt;?php
                              while ($selection = mysqli_fetch_assoc($age_query))
                              {
                                  echo "&lt;option value=\"{$selection['id']}\"&gt;{$selection['age']}&lt;/option&gt;\n";
                              }
                              ?&gt;
                              &lt;/select&gt;
                          &lt;/td&gt;
                       &lt;/tr&gt;
                       &lt;tr&gt;
                          &lt;td width="100"&gt; &lt;/td&gt;
                          &lt;td&gt;
                             &lt;input name="insert" type="submit" id="insert" value="Insert"&gt;
                          &lt;/td&gt;
                       &lt;/tr&gt;                  
                    &lt;/table&gt;
                 &lt;/form&gt;
              &lt;?php
           }
        ?&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  &lt;?php
      mysqli_close($connection);
  ?&gt;
  </code></pre>
  
  <p>The output if I type <code>Test</code> in the user and select a number in the age, the age is not sent through, and it shows <code>Database Updated Test</code> with no age. What am I missing?</p>
  
  <p><strong>----- ADDED INFORMATION 1 -----</strong></p>
  
  <p>This is the query that creates the <code>$age_query</code> as requested</p>
  
  <pre><code>&lt;?php
  //Perfom DB query
  $query = "SELECT * FROM PermittedAges ";
  $query .= "ORDER BY Age asc";
  $age_query = mysqli_query($connection, $query);
  
  //Test for query error
  if (!$age_query) {
      die ("Database query failed.");
  }
  ?&gt;
  </code></pre>
  
  <p>But I am not sure how this could be the problem since this only populates the options in the drop-down field an it works</p>
  
  <p><strong>----- ADDED INFORMATION 2 -----</strong></p>
  
  <p>Here is the <code>var_dump($_POST)</code> output</p>
  
  <pre><code>array(3) { ["user_added"]=&gt; string(4) "Test" ["Age_added"]=&gt; string(0) "" ["insert"]=&gt; string(6) "Insert" }
  </code></pre>