title: how to insert data from dropdown list to database
body: <p>Since I already have the data in the dropdown list, how do i reflect it in the database? The database should show the exact admin no, student, gpa and one of the option from the drop down list. Do I need to use an if else statement? </p>
  
  <pre><code>&lt;form name="IT" action="getIT_now.php" method="post"&gt;     
          &lt;?php
              $result = mysqli_query($con,"SELECT admin_no, name, GPA, gender FROM student_details WHERE jobscope1= 'IT' ORDER BY `GPA` DESC; ");
  
                  $result2 = mysqli_query($con, "SELECT job_title FROM job_details WHERE jobscope='IT';");
                  $row2 = mysqli_fetch_assoc($result2);
  
                  echo "&lt;table border='1' &gt;
                  &lt;tr&gt;
                  &lt;th&gt;Admin Number&lt;/th&gt;
                  &lt;th&gt;Student Name&lt;/th&gt;
                  &lt;th&gt;GPA&lt;/th&gt;
                  &lt;th&gt;Gender&lt;/th&gt;
                  &lt;th&gt;Company List&lt;/th&gt;
                  &lt;/tr&gt;";
  
                   /*options sections start*/
                  $options= '';
                  while ($row2 = mysqli_fetch_array($result2))
                  {
                      $options .='&lt;option value="'. $row2['job_title'] .'"&gt; '. $row2['job_title'] .'&lt;/option&gt;';
                  }
                  /*options sections end*/
  
                  while($row = mysqli_fetch_assoc($result))
                    { 
  
  
  
  
                        echo "&lt;tr&gt;";
                        echo "&lt;td bgColor=white&gt;" . $row['admin_no'] . "&lt;/td&gt;";
                        echo "&lt;td bgColor=white&gt;" . $row['name'] . "&lt;/td&gt;";
                        echo "&lt;td bgColor=white&gt;" . $row['GPA'] . "&lt;/td&gt;";
                        echo "&lt;td bgColor=white&gt;" . $row['gender'] . "&lt;/td&gt;"; 
                        echo "&lt;td&gt;&lt;select name='ddl' onclick='if(this.value != '') { myform.submit(); }'&gt;".$options."&lt;/select&gt;&lt;/td&gt;";
                    }
                        echo "&lt;/tr&gt;";              
  
                        echo "&lt;/table&gt;";
  
  
  
      ?&gt;
      &lt;input type="submit" name="submit" id="submit" value="Submit" /&gt;
  
      &lt;/form&gt;
  </code></pre>