Call to undefined function mysqli_fetch_all() error [duplicate]

749
April 23, 2017, at 05:49 AM

This question already has an answer here:

  • mysqli_fetch_assoc() expects exactly 1 parameter, 2 given 1 answer
  • PHP Warning: mysqli_fetch_assoc() expects exactly 1 parameter, 3 given in 2 answers
  • mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 to be resource or mysqli_result, boolean given 33 answers

Hello i am trying to get data from mysql but taking this error

PHP Fatal error: Call to undefined function mysqli_fetch_all()

my php.index:

$sql = "SELECT SUM(HomelessID) as count FROM evsiz";
$viewer = mysqli_query($mysqli,$sql);
$viewer = mysqli_fetch_assoc($viewer,MYSQLI_ASSOC);
$viewer = json_encode(array_column($viewer, 'count'),JSON_NUMERIC_CHECK);

when i try mysqli_fetch_assoc instead of mysqli_fetch_all it gives this

mysqli_fetch_assoc() expects exactly 1 parameter, 2 given in...

What should i do here?

Rent Charter Buses Company
READ ALSO
Run Shell script file from Apache web server

Run Shell script file from Apache web server

I am running an Apache 2 webserverI would like to have a button which, when pressed, activates a shell script

365
Mixed result from MySQL Query, How to sort

Mixed result from MySQL Query, How to sort

I am querying a table called request that looks like this

348
How to get a VB.net application to run from an event in PHP [on hold]

How to get a VB.net application to run from an event in PHP [on hold]

my php code contains an array of urlsIs there a way to activate a Vb

302