title: Form values from dropdown list not passing
body: <p>I created a drop down list that has been populated by the database and now I'm having trouble retrieving the data. Normally, I would know how to retrieve the value of the drop down list if I had to manually name the data, but in this case, I'm not quite sure how I would name it.</p>
  
  <p>Here is my current code:</p>
  
  <pre><code>   &lt;h1&gt;Generate Reports&lt;/h1&gt;
  
       &lt;form enctype="multipart/form-data" action="http://localhost/yiiFolder/index.php/create" method="post"&gt;
         &lt;table&gt;
               &lt;tr&gt;
                  &lt;td&gt;&lt;strong&gt;Materials&lt;/strong&gt;&lt;/td&gt;
  &lt;?php
     mysql_connect('host', 'root', 'password');
     mysql_select_db ("db");
     $sql = "SELECT material_name FROM materials";
     $result = mysql_query($sql);
  
     echo "&lt;td&gt;&lt;select name='materials'&gt;";
  
         while ($row = mysql_fetch_array($result)) 
          {
              echo "&lt;option value='" . $row['material_name'] . "'&gt;" . 
              $row['material_name'] . "&lt;/option&gt;";
          }
  
         echo "&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt; ";
  
         $sql2 = "SELECT location_name From locations";
         $result2 = mysql_query($sql2);
  
  ?&gt;
  
  
   &lt;td&gt;&lt;strong&gt;Locations&lt;/strong&gt;&lt;/td&gt;
     &lt;?php
   echo "&lt;td&gt;&lt;select name='locations'&gt;";
      while ($row2 = mysql_fetch_array($result2)) 
          {
              echo "&lt;option value='" . $row2['location_name'] . "'&gt;" . 
              $row2['location_name'] . "&lt;/option&gt;";
          }   
  
  echo "&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;";
  
     ?&gt;
                      &lt;tr&gt;
                          &lt;td&gt;&lt;button name="submit" type=submit&gt;Generate&lt;/button&gt;&lt;/td&gt;
                      &lt;/tr&gt;
    &lt;/table&gt;
  
   &lt;/form&gt;
  
  
     &lt;?php 
  
  $material = $row['material_name'];
  $locations = $row2['location_name'];
  $generate = $_POST['submit'];
  
    if(isset($generate))
  {
      echo $material;
      echo $locations;
  }
  
   ?&gt;
  </code></pre>