mysqli_fetch_array
mysqli_fetch_array — Fetch a result row as an associative, a numeric array, or both.Description
mysqli_fetch_array( mysqli_result $result,Returns an array that corresponds to the fetched row or null if there are no more rows for the result set. In addition to storing the data in the numeric indices of the result array, this function can also store the data in associative indices by using the field names of the result set as keys.
int $mode = MYSQLI_BOTH ): array|null|false
Note: Field names returned by this function are case-sensitive.
Note: This function sets NULL fields to the PHP null value.
If two or more columns of the result have the same field names, the last column will take precedence and overwrite the earlier data. In order to access multiple columns with the same name, the numerically indexed version of the row must be used.
Parameters
result
Procedural style only: A mysqli_result object returned by mysqli_query(), mysqli_store_result(), mysqli_use_result() or mysqli_stmt_get_result().
mode
This optional parameter is a constant indicating what type of array should be produced from the current row data. The possible values for this parameter are the constants MYSQLI_ASSOC, MYSQLI_NUM, or MYSQLI_BOTH.
By using the MYSQLI_ASSOC constant this function will behave identically to the mysqli_fetch_assoc(), while MYSQLI_NUM will behave identically to the mysqli_fetch_row() function. The final option MYSQLI_BOTH will create a single array with the attributes of both.
Return Values
Returns an array of values that corresponds to the fetched row or null if there are no more rows in result set.More information about mysqli_fetch_array on official PHP documentation site
mysqli_fetch_array - Popular snippets
- PHP 8.1 / MySQL 5.7 printf mysqli_num_rows mysqli_fetch_array
last run:
2023-05-17 07:38:58
23
- PHP 7.4 / MySQL 8.0 mysqli_prepare mysqli_fetch_array
last run:
2023-07-15 06:41:31
15
- PHP 8.1 / MySQL 5.7 printf mysqli_num_rows mysqli_fetch_array
last run:
2023-05-17 07:39:52
11
- PHP 8.1 / MySQL 8.0 mysqli_query mysqli_fetch_array
last run:
2023-02-01 18:50:42
8
- PHP 8.1 / MySQL 8.0 mysqli_fetch_array print_r
last run:
2024-11-03 06:19:02
6
- PHP 8.1 / MySQL 5.7 printf mysqli_num_rows mysqli_fetch_array
last run:
2023-05-16 20:31:54
6
- PHP 8.1 / MySQL 8.0 printf phpversion mysqli_fetch_array
last run:
2022-11-30 08:36:53
6
- PHP 8.1 / MySQL 5.7 mysqli_query mysqli_fetch_array
last run:
2022-11-07 04:53:53
6
- PHP 8.0 / MySQL 5.7 date mysqli_query mysqli_fetch_array var_export
last run:
2023-08-11 11:30:02
6
- PHP 8.0 / MySQL 5.7 mysqli_fetch_array str_replace
last run:
2022-04-29 12:45:16
5
mysqli_fetch_array - New snippets
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 05:45:46
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:33:54
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:33:50
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:33:15
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:33:04
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:32:56
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:26:13
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:26:04
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:25:37
1
-
PHP 8.1 / MySQL 5.7 mysqli_fetch_array
added at:
2024-11-19 00:25:22
1