Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Call to undefined method mysqli_stmt::get_result() but mysqlnd seems installed

Tags:

php

mysqli

I am getting

Call to undefined method mysqli_stmt::get_result()

for the below php code at line $result = $stmt->get_result(). I am using laravel framework for this project;

   $conn = new mysqli($hostname, $username, $password, $db);
   $stmt = $conn->prepare("select name from user where username=?");
   $stmt->bind_param("s", "username");
   $stmt->execute();
   $result = $stmt->get_result();

PHP version is 5.4.43.

Below are the settings I found from phpinfo().

enter image description here

enter image description here

enter image description here

like image 293
mahesh Avatar asked Feb 03 '26 03:02

mahesh


1 Answers

Mysqli ext is built without mysqlnd support as it's absent in "API Extensions" and "Client API library version". It seems you need to recompile mysqli, or - better - just re-install it using packet manager.

like image 83
Your Common Sense Avatar answered Feb 04 '26 18:02

Your Common Sense



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!