mysqli_fetch_all stopped working on PHP 5.4.11

时间秒杀一切 提交于 2021-01-27 05:42:08

问题


I have a basic site with a host and as of recent the mysqli_fetch_all command has appeared to have stopped working as I receive the message:

Fatal error: Call to undefined function mysqli_fetch_all() in file at line where function is used

I rolled back the files on the server to a set that I know work and yet I run into the same issue even though the page is running PHP5.4+.

I cannot figure out why this has suddenly stopped working. Offline, using XAMPP, the mysqli_fetch_all command works perfectly and therefore the issue doesn't seem to be with the DB or the code. I would prefer not to rewrite numerous pages with a while loop for an unknown reason.

Is this an issue with the server host? Any help would be most appreciated.


回答1:


There are two ways the MySQLi extension may be compiled:

  1. By linking it against MySQL's client library
  2. By compiling against the MySQL Native Driver that is bundled with php (mysqlnd)

mysqli_fetch_all() is only available in the second case, see http://php.net/mysqli_fetch_all

I would recommend to avoid such mysqlnd-only functions for compatibility reasons. If compatibility is not an issue for you and you desperately need this function, you have to recompile php --with-mysqli=mysqlnd.



来源:https://stackoverflow.com/questions/15029271/mysqli-fetch-all-stopped-working-on-php-5-4-11

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