title: How to edit the value updated in a database from the form using php and mysql
body: <p>I want to edit the data which is already in the databse.
  Suppose I have updated my database, but after an year the user who has updated that database want to edit something like his address which is changed now through the form, then how can we do that. I am posting </p>
  
  <pre><code>      &lt;?php
     // Create Local variable
          $taken = "false";
          $database = "railway";
          $password = "";
          $username = "root";
  
          // Main if statement
          //if($userreg &amp;&amp; $passreg){
  
          // Connect to database
          $con = mysqli_connect('localhost', $username, $password,$database);
  
                          if ($con-&gt;connect_error) {
                              die("Connection failed: " . $con-&gt;connect_error);
                          }
  
  
  
  
  
                     ---------
                WHAT TO WRITE IN BETWEEN              
                   ----------------
  
  
  
  
        mysqli_close($con);
  </code></pre>
  
  <p>Suppose my table name is Railway and the attributes are <strong>time</strong>, <strong>name</strong>, <strong>station_to</strong>  and <strong>station_from</strong>.  I want to change the <strong>name</strong>. </p>
  
  <p>Please write both the form as well as <strong>php</strong> and <strong>mysql query</strong>.</p>