title: comparing a password md5 php/mysql
body: <p>I'm trying to compare the value of the password stored in the database (which is done by <code>md5($mypassword)</code>), but every time I enter a different password than what is in the DB it still allows me to auth the user... I've tried: </p>
  
  <pre><code>$rslt['password'] = md5($mypassword)
  $rslt['password'] == md5($mypassword)
  $rslt['password'] === md5($mypassword)
  </code></pre>
  
  <p>but neither of them seem to work.</p>
  
  <hr>
  
  <p>a snippet of the code is below:</p>
  
  <pre><code>if((mysql_num_rows($qry)==1)&amp;&amp;($rslt['username']==$myusername)&amp;&amp;($rslt['password'] == md5($mypassword)))
      {
      echo $rslt['username'];
      echo $myusername;
      echo $rslt['password'];
      echo md5($mypassword);
      //$expire=time()+60*60*24*30;
      //$_SESSION['user'] = $rslt['username'];
      //header("location: ../acct_beta.php");
      }
  </code></pre>
  
  <p>any ideas would be helpful. thanks :D</p>