PHP Fatal Error: Call to Undefined Function MySQLi_Stmt_Get_Result()

PHP Fatal error: Call to undefined function mysqli_stmt_get_result()

Do you have the mysqlnd driver properly installed? Per a comment in the Manual:

If you don't have mysqlnd installed/loaded whatever, you will get an
undefined reference when trying to call "mysqli_stmt_get_result()".

Also, there are discussions about this issue here and here.

Lastly, here's a forum discussing info pertaining to using the driver with cpanel that you may find useful.

Fatal error: Call to undefined method mysqli_stmt::get_result()

This is too long for a comment.

Try this:

if($statement=$conn->prepare("SELECT * FROM users WHERE token= ? LIMIT 1")){

$statement-> bind_param('s',$cvalue);

// Execute
$statement-> execute();

// Bind results
$statement-> bind_result($token);

// Fetch value
while ( $statement-> fetch() ) {
echo $token . "<br>";
}

// Close statement
$statement-> close();
}

// Close entire connection
$conn-> close();

Now, if while ( $statement-> fetch() ) doesn't work quite like you want it to, try replacing it with while ( $statement-> fetch_assoc() ), the way you have it now.

  • N.B.: If this doesn't work for you, I will simply delete the answer.

Footnotes:

As Rocket Hazmat stated in a comment, and I quote: It requires both PHP 5.3+ and the mysqlnd driver.

So, make sure that the driver is installed.

  • http://php.net/manual/en/book.mysqlnd.php
  • http://php.net/manual/en/mysqlnd.install.php

Call to undefined method mysqli_stmt::get_result

Please read the user notes for this method:

http://php.net/manual/en/mysqli-stmt.get-result.php

It requires the mysqlnd driver... If it isn't installed on your webspace you will have to work with bind_result() & fetch()!



Related Topics



Leave a reply



Submit