Difference between PHP extensions mysqli and nd_mysqli [duplicate]

混江龙づ霸主 提交于 2020-12-31 15:21:35

问题


Mysqli prepared statements like the one below throw the following error when get_result() is called.

$stmt = $connection -> prepare("select column from table where id = ?");
$stmt -> bind_param("i", $id);
$id = 1;
$stmt -> execute() or trigger_error($stmt -> execute(), E_USER_ERROR);
$stmt_result = $stmt -> get_result();
$stmt_numrows = $stmt_result -> num_rows;
$stmt -> close();

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

After reading the contribution section of the manual, it looks like it's a module issue. The doc here http://php.net/manual/en/mysqli-stmt.get-result.php states "Available only with mysqlnd", which is already enabled on the server.

It seems that everything works when I disable the mysqli extension and enable nd_mysqli instead (also recommended here: get_result() Doesn't Work even mysqlnd is enabled but with no further explanation).

I'd like to know what else I commit to by swapping these two extensions since they conflict with one another and can't be enabled together. Am I going to lose some features in the process? What's the difference between these two extensions exactly besides nd_mysqli including get_result()?

来源:https://stackoverflow.com/questions/53871567/difference-between-php-extensions-mysqli-and-nd-mysqli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!