On my regular computer this works fine, but on my host, which is hostgator, I keep getting this fatal error. it's saying the undefined function mysqli_stmt_get_result()
fatal error: Uncaught Error: Call to undefined function mysqli_stmt_get_result() in /home2/joe773/myblogs.live/loginSocialMediaPosts/includes/login.php:17 Stack trace: #0 {main} thrown in /home2/joe773/myblogs.live/loginSocialMediaPosts/includes/login.php on line 17
if(isset($_POST['login-submit'])) {
require "../config/db.php";
$unameEmail = $_POST['unameEmail'];
$password = $_POST['pwd'];
$sql = "SELECT * FROM users WHERE username=? OR email=?; ";
$stmt = mysqli_stmt_init($conn);
if(!mysqli_stmt_prepare($stmt, $sql)) {
header("Location: ../index.php?error=sqlerror");
}else{
mysqli_stmt_bind_param($stmt, "ss", $unameEmail, $unameEmail);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
if($row = mysqli_fetch_assoc($result)) {
$pwdCheck = password_verify($password, $row['password']);
if($pwdCheck == false) {
header("Location: ../index.php?error=wrongPassword");
exit();
}elseif($pwdCheck == true) {
session_start();
$_SESSION['userId'] = $row['id'];
$_SESSION['username'] = $row['username'];
header("Location: ../index.php?login=success");
}
}else{
header('Location: ../index.php?error=wrongPassword');
}
}
}