Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP mysqli_fetch_array() Function

PHP mysqli_fetch_array() Function

PHP MySQLi Reference Manual PHP MySQLi Reference Manual

Fetch a row from a result set as a numeric or associative array:

mysqli_fetch_array()


Definition and Usage

The mysqli_fetch_array() function fetches a row from a result set as an associative array, a numeric array, or both.

**Note:** The field names returned by this function are case-sensitive.


Syntax

mysqli_fetch_array(

result,resulttype

)

;

Parameters Description
result Required. Specifies the result set identifier returned by mysqli_query(), mysqli_store_result(), or mysqli_use_result().
resulttype Optional. Specifies which type of array should be produced. Can be one of the following values:
  • MYSQLI_ASSOC
  • MYSQLI_NUM
  • MYSQLI_BOTH
  • |

    Technical Details

    Return Value: Returns an array of strings matching the fetched row, or NULL if there are no more rows in the result set.
    PHP Version: 5+

    PHP MySQLi Reference Manual PHP MySQLi Reference Manual