As the name implies, I have mysqlnd available on my shared hosting server with PHP version 5.4. When I try to call the mysqli get_result () function, I get this error.
I spoke with the hosting provider several times, and most recently they told me to try to run
I hopped on ssh and ran this command that gave this:
mysqlnd mysqlnd => enabled Version => mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $ Loaded plugins => mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password mysqlnd statistics => Client API version => mysqlnd 5.0.10 - 20111026 - $Id: c85105d7c6f7d70d609bb4c000257868a40840ab $
So it seems to me as I expected.
I found another piece of PHP code in another forum that suggests running:
$hasMySQL = false; $hasMySQLi = false; $withMySQLnd = false; $sentence = ''; if (function_exists('mysql_connect')) { $hasMySQL = true; $sentence.= "(Deprecated) MySQL <b>is installed</b> "; } else $sentence.= "(Deprecated) MySQL <b>is not</b> installed "; if (function_exists('mysqli_connect')) { $hasMySQLi = true; $sentence.= "and the new (improved) MySQL <b>is installed</b>. "; } else $sentence.= "and the new (improved) MySQL <b>is not installed</b>. "; if (function_exists('mysqli_get_client_stats')) { $withMySQLnd = true; $sentence.= "This server is using MySQLnd as the driver."; } else $sentence.= "This server is using libmysqlclient as the driver."; echo $sentence;
I did this and got the result:
(Deprecated) MySQL is installed and the new (improved) MySQL is installed. This server uses libmysqlclient as a driver.
I start my hosting with Arvixe, and they have a blog post that says, "Run PHP 5.4 and it will work." Itβs clear to me that they think this function should work, but it gives me a fatal error.
Side note - the code works fine on my local machine, and I get an error with the call to get_result ().
EDITED:
This is how PHP is configured:
$stmt = $con->prepare("SELECT * FROM User_Details WHERE LCASE(username) = LCASE(?) LIMIT 1"); $stmt->bind_param("s", $username); $stmt->execute(); $result = $stmt->get_result();