connect_error) { echo "

Connection Error!

"; die ($conn->error); }else{ $myQuery = "select password from users where userName='jschmoe'"; $result = $conn->query($myQuery); // first check if we have the user if ($result->num_rows == 0) { echo "No user named 'jschmoe'"; die($conn->error); } else { // now get the hashed password $hashedPassword = ($result->fetch_object())->password; // check if the hashed password matches the // hash value of the given password if (password_verify ($plainPassword, $hashedPassword)) // it is verified!! echo "Enter, jschmoe!"; else echo "Password invalid!"; } } ?>