title: PHP checkbox updates database but drop drop menu doesn't
body: <p>I have the following script on checkboxes that works and updates my database accordingly.</p>
  
  <pre><code> while($row = mysql_fetch_array($result)){
  
  $host = $row['host'];
  $environment = $row['environment'];
  
  echo "&lt;tr&gt;&lt;td&gt;" . $host . "&lt;/td&gt;&lt;td&gt;" . $environment . "&lt;/td&gt;&lt;td&gt;&lt;input type='checkbox' name='id[]' value='" . $host . "'/&gt;&lt;/td&gt;&lt;/tr&gt;";
  }
  
   echo "&lt;/tbody&gt;&lt;/table&gt;&lt;input type='submit' value='submit'&gt;&lt;/form&gt;";
  
  if(gettype($_POST['id'])=="array"){
  foreach($_POST['id'] as $val){
   $id_c = $val;
   $query1 = "UPDATE hosts SET reboot = 'Yes' where host='".$id_c."'";
   $result= mysql_query($query1);
   if($result === false) {
      die(mysql_error());
   }
   echo "Reboot updated for Host " .$id_c. " is updated. &lt;br&gt;
  </code></pre>
  
  <p>but when I replace it with checkboxes it doesn't work. The checkbox script is below.</p>
  
  <pre><code>while($row = mysql_fetch_array($result)){
  
  $host = $row['host'];
  $environment = $row['environment'];
  
  echo "&lt;tr&gt;&lt;td&gt;" . $host . "&lt;/td&gt;
        &lt;td&gt;&lt;select name='id[".$host."]'&gt;&lt;option value='Null'&gt;Select any&lt;/option&gt;
                                &lt;option value='DEV/QA/TEST'&gt;DEV/QA/TEST&lt;/option&gt;
                                &lt;option value='PROD/STAGE'&gt;PROD/STAGE&lt;/option&gt;
                                &lt;/select&gt;&lt;/td&gt;
                                &lt;td&gt;" . $environment . "&lt;/td&gt;&lt;/tr&gt;"; }
  
  
  echo "&lt;/tbody&gt;&lt;/table&gt;&lt;input type='submit' value='submit'&gt;&lt;/form&gt;";
  
  if (gettype($_POST['id'])=="array") {
  
      foreach($_POST['id'] as $host =&gt; $val){
  
              $id_c = $val;
  if ($val != 'Null') {
              $query1 = "UPDATE hosts SET environment = '$val' where host='$host'";
  
              $result1 = mysql_query($query1);
  
              if($result1 === false) {
  
              die(mysql_error());
           }
  
       echo "Environment for Host " .$host. " is updated. &lt;br&gt;";
  
  }}}
  </code></pre>
  
  <p>Working updated script is here now.</p>