seems like there is some kind of error in get_result() in prepared statement. the below function was working perfectly fine until 2 days ago. Can anyone please help me to find whats the problem with the below function.
class userDetails{
public function searchUser($conn){
$userList = [];
$user = '%fernan%';
$query = $conn->prepare("SELECT username FROM users WHERE lastName LIKE ? ");
$query->bind_param('s',$user);
$query->execute();
$getResult = $query->get_result();
if($getResult->num_rows > 0){
while($names = $getResult->fetch_assoc()){
$userList[] = $names['username'];
}
}
return $userList;
}
}
it throws HTTP ERROR 500. my php current Version 5.4.45 and below is the error it give.. PHP Fatal error: Call to undefined method mysqli_stmt::get_result() Thanks in advance.