title: Update table in phpmyadmin using input
body: <p>I have been trying to make an online gateway for my college, where staff can nominate students for particular post or prizes.  I used php with css for front end and phpmyadmin for back end.  But once i give the input(regno) to nominate a student, it doesn't update in the table.  Can anyone help? This is my code:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;NOMINATE ENTRIES&lt;/title&gt;
  &lt;meta author="" content=""&gt;
  &lt;link rel="stylesheet" type="text/css" href="view.css" media="all"&gt;
  &lt;/head&gt;
  &lt;body id="main_body" &gt;
      &lt;img id="top" src="top.png" alt=""&gt;
      &lt;div id="form_container"&gt;
          &lt;h1&gt;&lt;a&gt;Nominate Entries&lt;/a&gt;&lt;/h1&gt;
          &lt;form name="form5" class="appnitro"  method="post" action="test.php"&gt;
                      &lt;div class="form_description"&gt;
              &lt;center&gt;&lt;h2&gt;Students Database&lt;/h2&gt;&lt;/center&gt;
              &lt;p&gt;&lt;center&gt;&lt;font size='3'&gt;
  
  &lt;?php
  $con=mysqli_connect("localhost","staff","12345","mop");
  // Check connection
  if (mysqli_connect_errno())
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }
  
  $result = mysqli_query($con,"SELECT * FROM `student` WHERE `Nominated` = 0");
  
  echo "&lt;table border='1'&gt;
  &lt;tr&gt;
  &lt;th&gt;Register No&lt;/th&gt;
  &lt;th&gt;Department &amp;nbsp &lt;/th&gt;
  &lt;th&gt;Name &amp;nbsp &amp;nbsp &amp;nbsp &lt;/th&gt;
  &lt;th&gt;Class &amp;nbsp &lt;/th&gt;
  &lt;/tr&gt;";
  
  while($row = mysqli_fetch_array($result))
    {
    echo "&lt;tr&gt;";
    echo "&lt;td&gt;" . $row['RegNo'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Name'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Department'] . "&lt;/td&gt;";
    echo "&lt;td&gt;" . $row['Class'] . "&lt;/td&gt;";
    echo "&lt;/tr&gt;";
    }
  echo "&lt;/table&gt;";
  
  if(isset($_POST['submit']))
  {
  $regno = $_POST['regno'];
  $reason = $_POST['reason'];
  $sql = "UPDATE `mop`.`student` SET `Nominated` = \'1\' WHERE `student`.`RegNo` = 1106103;";}
  mysqli_close($con);
  ?&gt;
  &lt;/center&gt;&lt;/font&gt;
              &lt;/p&gt;
          &lt;/div&gt;  
          &lt;b&gt;Enter Register Number &lt;font color='red'&gt;*&lt;/font&gt; &lt;/b&gt; &lt;input type="text" id="regno" name="regno"&gt;&lt;br&gt;
          &lt;b&gt;Enter Reason &lt;font color='red'&gt;*&lt;/font&gt; &lt;/b&gt; &lt;input type="text" id="reason" name="reason"&gt;&lt;br&gt;
              &lt;ul &gt;
                      &lt;center&gt;&lt;li class="buttons"&gt;
                  &lt;input type="hidden" name="form_id" value="768845" /&gt;
                  &lt;input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" /&gt;&lt;/center&gt;
          &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/form&gt; 
      &lt;/div&gt;
      &lt;img id="bottom" src="bottom.png" alt=""&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>