My code code returns the error on line 5:
Fatal error: Call to undefined method mysqli_stmt::get_result()
$email = $_POST['email'];
$stmt = $con->prepare("SELECT password FROM users WHERE email=?");
$stmt->bind_param("s", $email);
$stmt->execute();
$result = $stmt->get_result();
$num_of_rows = $stmt->num_rows;
if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
$password = $row['password'];
$verify = password_verify($_POST['password'], $password);
if ($verify) {
echo "success";
}
else {
echo "not success";
}
}
}
else {
echo "incorrect username or password";
}
I'm running PHP 5.6 and mysqlnd is enabled.