title: PHP form : not updating mysql database
body: <p>I have virtually no programming experience and trying this first project, I am a bit stuck on how to update the database, so I click on edit and the correct record gets loaded into the edit screen update.php</p>
  
  <p>When I click update, I get the message from updated.php saying that the database has been updated, but the database does not get updated, when I display the records they are the same as before the update, thanks in advance for all your help.</p>
  
  <p>the following code:</p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
  "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Form Edit Data&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;table border=1&gt;
      &lt;tr&gt;
          &lt;td align=center&gt;Form Edit Employees Data&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;
          &lt;table&gt;
          &lt;?
          $user_name = "";
          $password = "";
          $database = "";
          $server = "localhost";
  
          mysql_connect($server, $user_name, $password);
          $db_found = mysql_select_db($database);
          $id = $_GET['id'];
          $order = "SELECT * FROM MY_ID where ID = ' " .$id . " ' ";
          $result = mysql_query($order);
          $row = mysql_fetch_array($result);
          ?&gt;
          &lt;form method="post" action="edit_data.php"?id=&lt;?= $id ?&gt;&gt;
              &lt;input type="text" name="id" value="&lt;? echo "$row[ID]"?&gt;"&gt;
              &lt;tr&gt;        
                  &lt;td&gt;First Name&lt;/td&gt;
                  &lt;td&gt;
                      &lt;input type="text" name="FirsName" size="20" value="&lt;? echo "$row[FirstName]"?&gt;"&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Sur Name&lt;/td&gt;
                  &lt;td&gt;
                      &lt;input type="text" name="SurName" size="40" value="&lt;? echo "$row[SurName]"?&gt;"&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Address&lt;/td&gt;
                  &lt;td&gt;
                      &lt;input type="text" name="Address" size="40" value="&lt;? echo "$row[Address]"?&gt;"&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td align="right"&gt;
                      &lt;input type="submit" name="submit" value="submit"&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/form&gt;
          &lt;/table&gt;
  
      &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and here is the other file</p>
  
  <pre><code>&lt;?php
  $user_name = "";
  $password = "";
  $database = "";
  $server = "";
  
  mysql_connect($server, $user_name, $password);
  $db_found = mysql_select_db($database);
  
  $id = $_REQUEST['ID'];
  $FirstName = trim(mysql_real_escape_string($_POST["FirstName"]));
  $SurName = trim(mysql_real_escape_string($_POST["SurName"]));
  $Address = trim(mysql_real_escape_string($_POST["Address"]));
  
  $sql = "UPDATE MY_ID SET FirstName='$FirstName',SurName='$SurName',Address='$Address' WHERE ID='$id'";
  $result=mysql_query($sql);
  
  
  if ($result){
      echo "Successful";
      echo "&lt;BR&gt;";
      echo "&lt;a href='edit.php'&gt;View result&lt;/a&gt;";
  }
  else {
      echo "ERROR";
  }
  
  ?&gt;
  </code></pre>