title: How to store a forms dropdown list selected value into mysql database
body: <p>Have a form with a dropdown list. How can I get the value the user selects into my data base once a user submits the form? Can't get the code below to store the user selected value?  Thanks for your help.</p>
  
  <p><strong>FORM</strong></p>
  
  <pre><code>&lt;form action="xxx.php" class="well" id="xxx" name"xxx" method="post"&gt;
  
  
  &lt;select name="extrafield5"&gt;
   &lt;option value="NOW" selected="selceted"&gt;Submit order now&lt;/option&gt;
   &lt;option value="REVIEW"&gt;Submit my order for review&lt;/option&gt;
  &lt;/select&gt;
  
  
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>PHP FILE</strong></p>
  
  <pre><code>&lt;?php
  
  define('DB_NAME', 'xxx');
  define('DB_USER', 'xxx');
  define('DB_PASSWORD', 'xxx');
  define('DB_HOST', 'xxx');
  
  $connection = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD);
  
  if(!$connection){
  die('Database connection failed: ' . mysqli_connect_error());
  }
  
  $db_selected = mysqli_select_db($connection, DB_NAME);
  
  if(!$db_selected){
  die('Can\'t use ' .DB_NAME . ' : ' . mysqli_connect_error());
  }
  
  echo 'Connected successfully';
  
  
  if (isset($_POST['extrafield5'])){
      $extrafield5 = $_POST['extrafield5'];
  }
  
  else {$extrafield5 = '';}
  
  
  
  
  $sql = "INSERT INTO seguin_orders (extrafield5) 
          VALUES ('$extrafield5')";
  
  if (!mysqli_query($connection, $sql)){
  die('Error: ' . mysqli_connect_error($connection));
  }
  </code></pre>
  
  <p><strong>DATABASE</strong></p>
  
  <p><a href="http://oi60.tinypic.com/9ppc0i.jpg" rel="nofollow">http://oi60.tinypic.com/9ppc0i.jpg</a></p>