问题
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:
- By linking it against MySQL's client library
- 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