title: Password_verify in PHP
body: <p>So I'm enabling users to create accounts with a username and password. I have managed to encrypt the password when a user creates a new account using:</p>
  
  <pre><code>$hash = password_hash($password, PASSWORD_BCRYPT);
  </code></pre>
  
  <p>However I'm having trouble with password_verify when logging in, could someone please help me with what I have? I know it's something like this:</p>
  
  <pre><code>password_verify($password, $hash)
  </code></pre>
  
  <p>But I don't know how to structure it or where to add it in the code. Thanks in advance. This is what I have:</p>
  
  <pre><code>&lt;?php
  if (isset($_GET["username"])  &amp;&amp; isset($_GET["password"]) ){
      $username = $_GET["username"];
      $password = $_GET["password"];
      $result = login( $username, $password);
      echo $result;
  }
  
  function makeSqlConnection()
  {
      $DB_HostName = "";
      $DB_Name = "";
      $DB_User = "";
      $DB_Pass = "";
  
      $con = mysql_connect($DB_HostName,$DB_User,$DB_Pass) or die(mysql_error()); 
  
      mysql_select_db($DB_Name,$con) or die(mysql_error()); 
  
      return $con;
  }
  
  function disconnectSqlConnection($con)
  {
      mysql_close($con);
  }
  
  function login($username, $password)
  {
      $con = makeSqlConnection();
      $sql = "select * from login  where username = '$username' and password = '$password';";
      $res = mysql_query($sql,$con) or die(mysql_error());
  
      $res1 = mysql_num_rows($res);
  
      disconnectSqlConnection($con);
  
       if ($res1 != 0) {
          return 1;
      }else{
          return 0;
      }// end else
  
  }// end of Function 
  ?&gt;
  </code></pre>