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
Which Is Faster and Better, Switch Case or If Else If
Rounding to Nearest Fraction (Half, Quarter, etc.)
Handle Fatal Errors in PHP Using Register_Shutdown_Function()
How to Loop Through a MySQL Query via Pdo in PHP
PHP to Store Images in MySQL or Not
Uploading a File in Chunks Using HTML5
What Is the Best Practice to Export Canvas with High Quality Images
How to Identify Server Ip Address in PHP
Verify Imagemagick Installation
Type Casting for User Defined Objects
How to Create a Zip File Using PHP
Convert Utc Dates to Local Time in PHP
Converting a Number Base 10 to Base 62 (A-Za-Z0-9)
PHP Conditionals, Brackets Needed
How to Get the Unicode Value of a Character or Vise Versa with PHP
What Is the Equivalent of JavaScript's Encodeuricomponent in PHP