PHP mysqli_fetch_all() Function

PHP mysqli_fetch_all() function is used to fetch all result rows as an associative array, a numeric array, or both.

Syntax

mysqli_fetch_all() Function Parameter

ParameterDescription
result :Required parameter. Mention a result set identifier returned by mysqli_query().
resulttype :Optional paramater. Mention type of array that should be generated. The resulttype could be MYSQLI_ASSOC or MYSQLI_NUM or MYSQLI_BOTH.

mysqli_fetch_all() Function Return Value

Return Values :Returns associative array or numeric array that hold the result rows.

mysqli_fetch_all() Function Example