Hướng dẫn php fetcharray
mysqli_fetch_array(PHP 5, PHP 7, PHP 8) mysqli_result::fetch_array -- mysqli_fetch_array — Fetch the next row of a result set as an associative, a numeric array, or both DescriptionObject-oriented style public
mysqli_result::fetch_array(int mysqli_fetch_array(mysqli_result 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. If two or more columns of the result have the same name, the last column will take precedence and overwrite any previous data. To access multiple columns with the same name, the numerically indexed version of the row must be used.
Parametersresult 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 By using the Return Values Returns an array representing the fetched row, ExamplesExample #1 mysqli_result::fetch_array() example Object-oriented style
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); Procedural style
(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); The above examples will output something similar to: Kabul (AFG) Qandahar (AFG) Herat (AFG) See Also
There are no user contributed notes for this page. |