title: Updating MySQL database with MD5 value
body: <p>Having searched thoroughly through my code, the only reason that I could determine for this error is that the technique I am using for converting the string to MD5 is invalid. However I cannot find another way to do so.</p>
  
  <pre><code>$username = $_POST['username'];
  $password = $_POST['password'];
  $repassword = $_POST['repassword'];
  if( $password=$repassword ) {
      $con=mysql_connect("localhost", "root", "");
  
      if( $con == true ) {
          mysql_select_db("movedb", $con);
          //$newpassword = mysql_real_escape_string(md5($_POST['password']));
          $query = "UPDATE user SET password=MD5('$password') WHERE username='$username'";
          // $query = "UPDATE user SET password='$newpassword' WHERE username='$username'";
          $result = mysql_query($query, $con);
  
          if( $result == true ) { 
              echo "Successfully saved your message";
          } else {
              echo mysql_error();
          }   
  
          mysql_close($con);
      } else {
              echo "Cannot connect to the database";
      }
  
  } else {
      echo "Passwords do not match!";
  }
  </code></pre>
  
  <p>Any ideas on how to update this MD5 value from PHP</p>