I am developing a login system for an iOS app.
This is part of the PHP script that I am using to send a JSON response to the app:
if(isset($_POST['correo']) && isset($_POST['pass']) && $_POST['key'] == "123456")
{
    $password = $_POST['pass'];
    $q = mysqli_query($mysqli,"SELECT * FROM users WHERE email = '".$_POST['correo']."' AND 
    encrypted_password = '".$_POST['pass']."'") or die (mysqli_error());
    if(mysqli_num_rows($q) >= 1){
        $r = mysqli_fetch_array($q);
// this is the hash of the password in above example
            $hash = $r['encrypted_password'];
            if (password_verify($password, $hash)) {
                $results = Array("error" => "1","mensaje" => "su ID es ".$r['id'],"nombre" => $r['nombre'],"apellidos" => $r['apellidos'],"email" => $r['email'],
        "imagen" => $r['imagen'],"unidad" => $r['unidad']);
            } else {
                $results = Array("error" => "2","mensaje" => " acceso denegado ");
            }
    }else{
        $results = Array("error" => "3","mensaje" => "no existe");
    }
}
echo json_encode($results);
My issue is about using password_verify in PHP. I want to know if it should work as it is in the script or not, then the JSON response is not received in the app.
Thank you
 
    