The user is able to sign up to the website that I'm making and the password that is inserted into the database is hashed
$hashedpassword = password_hash($password, PASSWORD_DEFAULT);
Now when the user tries to login I'm not sure how to take the password they entered and compare it with the hashed version in the database, I tried this but it's not working
<?php
session_start();
$username = $_POST['username'];
$password = $_POST['password'];
$pwdcheck = password_verify($password, $row["password"]);
$conn = mysqli_connect("localhost", "root", "", "cadabra");
$query = "SELECT username, password from register where username=? AND password=? LIMIT 1";
$stmt = $conn->prepare($query);
$stmt->bind_param("ss", $username, $pwdcheck);
$stmt->execute();
$stmt->bind_result($username, $pwdcheck);
$stmt->store_result();
if($stmt->fetch()) {
$_SESSION["login_user"] = $username;
header("Location: ../Login.php?LoginSuccessful");
} else {
header("Location: ../Login.php?LOGINFAILED");
}
mysqli_close($conn);