0

I'm trying to get the fetch_all function working with mysqli. I know I need PHP > 5.3 and mysqlnd.

My server runs Debian Wheezy so I have PHP 5.5. I just removed php5-mysql and installed php5-mysqlnd.

phpinfo() shows that mysqlnd is installed, but when I try to use the fetch_all function I still get this error:

Undefined property: mysqli_result::$fetch_all

I call it like this:

$result->fetch_all[MYSQLI_ASSOC]

Am I missing something?

Compizfox
  • 748
  • 2
  • 7
  • 17

1 Answers1

1

This:

$result->fetch_all[MYSQLI_ASSOC]

is an array reference. fetch_all is a METHOD.

it should be

$result->fetch_all(MYSQLI_ASSOC)

note the change in bracket types.

Marc B
  • 356,200
  • 43
  • 426
  • 500