title: Crud functionality, Trying to update user details with php and mysql
body: <p>I'm new to php and I have a login system and an account which allows users to edit their details however when they fill in the form the database does not update and my error message does not show? Can anyone help?</p>
  
  <p>accountamend.php</p>
  
  <pre><code> &lt;?php
   include 'connection.php'; // this includes my connection to the database
  $ID=$_GET['ID'];
  $query="SELECT ID, email, password, FROM users WHERE ID=$ID";
  $result=mysqli_query($connection,$query) or die (mysqli_error($connection));
  if (mysqli_num_rows($result)&gt;0){
  $row=mysqli_fetch_assoc($result);
  } else {
  $row=NULL;
  }
  ?&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt; Update Details &lt;/title&gt;
  &lt;link rel="stylesheet" href="homecss.css"/&gt;
  &lt;link href='http://fonts.googleapis.com/css?family=Nunito:400,700' rel='stylesheet'       type='text/css'&gt;
   &lt;/head&gt;
   &lt;body&gt;
  &lt;form method ="post" action="amendaccount.php"&gt;
      &lt;fieldsetclass="fieldset-width"&gt;
   &lt;legend&gt;
  Enter New Details
  &lt;/legend&gt;
  &lt;input type="hidden" name"ID" value="&lt;?php echo $ID; ?&gt;" /&gt;
  &lt;label for="email"&gt;Email: &lt;/label&gt;
  &lt;input type = "text" name="email" value="&lt;?php echo $row['email']; ?&gt;" /&gt;
  &lt;br/&gt;
  &lt;label for ="password"&gt; Password: &lt;/label&gt;
  &lt;input type = "password" name="password" value="&lt;?php echo $row['password']; ?&gt;" /&gt;
  &lt;/fieldset&gt;
  &lt;input type="submit" value="submit" name="submit" /&gt;
  &lt;input type="reset" value="clear" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>editaccount.php</p>
  
  <pre><code> &lt;?php
  include 'connection.php';
  $ID=$_POST['ID'];
  $email=$_POST['email'];
  $password=$_POST['password'];
  
  $query="UPDATE users SET email='$email', password='$password' WHERE ID='$ID'";
  mysqli_query($connection,$query);
   echo "Update Success";
   ?&gt;
  </code></pre>