title: password_verify doesn't verify hash
body: <p>I hash my inserted passwords via password_hash. I verify them by using password_verify.</p>
  
  <p>However when I insert a hashed password in my database and I try to verify it, both outputs always differ from eachother.</p>
  
  <p>my pages are as following,</p>
  
  <p>main_login.php (form):</p>
  
  <pre><code>&lt;?php include 'header.php';?&gt;
  &lt;body&gt;
  &lt;form role="form" method="post" action="login.php"&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="usrname"&gt;Username:&lt;/label&gt;
      &lt;input type="text" class="form-control" name="usrname" placeholder="Enter username"&gt;
    &lt;/div&gt;
    &lt;div class="form-group"&gt;
      &lt;label for="passwrd"&gt;Password:&lt;/label&gt;
    &lt;/div&gt;
      &lt;input type="password" class="form-control" name="passwrd" placeholder="Enter password"&gt;
      &lt;br&gt;
    &lt;input type="checkbox"&gt;Remember Me
    &lt;br&gt;
    &lt;br&gt;
    &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>login.php (handler):</p>
  
  <pre><code>&lt;?php
  include 'vars.php';
  include 'header.php';
  $sql="SELECT * FROM members WHERE usrname='$usrname'";
  $result=mysqli_query($con,$sql);
  $count=mysqli_num_rows($result);
  $row=mysqli_fetch_row($result);
  $verify=password_verify($hash,$row[2]);
  if($verify){
      $_SESSION["usrname"]=$usrname;
      echo "Correct";
  }
  else {
      echo "user: " . $usrname. "&lt;br&gt;";
      echo "pass: " . $hash. "&lt;br&gt;";
      echo "db: " . $row[2]."&lt;br&gt;";
      echo "Wrong Username or Password";
  }
  ?&gt;
  </code></pre>
  
  <p>vars.php:</p>
  
  <pre><code>&lt;?php
  $h='localhost';$u='caelin';$p='****';$d='ombouwnh';
  $con=mysqli_connect($h,$u,$p,$d);
  $usrname=$_POST['usrname'];
  $passwrd=$_POST['passwrd'];
  $hash=password_hash($passwrd, PASSWORD_DEFAULT);
  ?&gt;
  </code></pre>
  
  <p>when i try to login using username 'caca' and password 'caca' I get a different output for both, everytime i retry.
  I can't find this particular problem on stackoverflow.</p>
  
  <p>TIA</p>
  
  <p>PS. If you need more details, ask for them</p>