5

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.

Basic Bridge
  • 1,881
  • 4
  • 25
  • 37
mjbk88
  • 71
  • 2
  • 6
  • whats the php version of XAMPP? This might help :http://stackoverflow.com/questions/6694437/mysqli-fetch-all-not-a-valid-function – meWantToLearn Feb 22 '13 at 16:58
  • XAMPP is running 5.4.7 whereas the host is running 5.4.11 retrieved using phpversion() As the function should be fine with PHP 5.3+ this behaviour seems unusual. – mjbk88 Feb 22 '13 at 17:09
  • The function is only available with the mysqlnd driver. The host may be using the older mysql driver. – Michael Berkowski Feb 22 '13 at 17:12

1 Answers1

4

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.