-2

an error stating "Fatal error: Call to undefined method mysqli_stmt::get_result() in C:\xampplite\htdocs\mydocs\appointments\appointment.php on line 10" shows up when I run my code.

This is the code below:

$stmt = $mysqli->prepare("select * from bookings where MONTH(date) = ? AND YEAR(date)=?");
$stmt->bind_param('ss', $month, $year);
$bookings = array();
if($stmt->execute()){
$result = $stmt->get_result();
if($result->num_rows>0){
    while($row = $result->fetch_assoc()){
        $bookings[] = $row['date'];
    }
    $stmt->close();
}
}
  • Check this [so link](https://stackoverflow.com/questions/8321096/call-to-undefined-method-mysqli-stmtget-result) – Ken Lee May 14 '22 at 13:56
  • You tagged it with XAMPP, but XAMPP doesn't offer mysqli compiled with libmysql to my knowledge, so either you gave us wrong information or you broke something in your XAMPP installation. FYI, libmysql isn't available on Windows... which is a good thing because you want mysqlnd not libmysql – Dharman May 14 '22 at 16:50

0 Answers0