title: Store input select option into database
body: <p>I want to save the input select option in the database with value of the option. But nothing is getting saved. What is wrong? I am saving the value as <code>varchar (10)</code> in the database.</p>
  
  <p><strong>FORM</strong></p>
  
  <pre><code>&lt;form name="stdntdetails" action="study.php" method="post"&gt;
      &lt;select name="department"&gt;
          &lt;option value="IT"&gt;Information Technology&lt;/option&gt;
          &lt;option value="IS"&gt;Information System&lt;/option&gt;
          &lt;option value="CS"&gt;Computer Science&lt;/option&gt;
      &lt;/select&gt;
      &lt;input type="submit" id="loginbtn" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php
  require_once("navig.php");
  require_once('connect.php');
  $dbb = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME)
    or die('Error communicating to MySQL server.');
  if(isset($_POST['loginbtn'])){
    if(isset($_POST['department'])){
      $department=$_POST['department'];
      $querye = "INSERT INTO tbl_name(department) ".
                          "VALUES ('$department')";
      $sql=mysqli_query($dbb,$querye);
      mysqli_close($dbb);                     
    }
  }
  ?&gt;
  </code></pre>