mysqli-result.fetch-array.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 170 行 · 第 1/2 页
HTML
170 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Fetch a result row as an associative, a numeric array, or both</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="mysqli-result.data-seek.html">mysqli_result::data_seek</a></div> <div class="next" style="text-align: right; float: right;"><a href="mysqli-result.fetch-assoc.html">mysqli_result::fetch_assoc</a></div> <div class="up"><a href="class.mysqli-result.html">MySQLi_Result</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="mysqli-result.fetch-array" class="refentry"> <div class="refnamediv"> <h1 class="refname">mysqli_result::fetch_array</h1> <h1 class="refname">mysqli_fetch_array</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">mysqli_result::fetch_array</span> -- <span class="refname">mysqli_fetch_array</span> — <span class="dc-title">Fetch a result row as an associative, a numeric array, or both</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <p class="para">Object oriented style (method):</p> <div class="methodsynopsis dc-description"> <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><b><b>mysqli_result::fetch_array</b></b></span> ([ <span class="methodparam"><span class="type">int</span> <tt class="parameter">$resulttype</tt></span> ] )</div> <p class="para rdfs-comment">Procedural style:</p> <div class="methodsynopsis dc-description"> <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <span class="methodname"><b><b>mysqli_fetch_array</b></b></span> ( <span class="methodparam"><span class="type"><span class="type mysqli_result">mysqli_result</span></span> <tt class="parameter">$result</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$resulttype</tt></span> ] )</div> <p class="para rdfs-comment"> Returns an array that corresponds to the fetched row or <b><tt>NULL</tt></b> if there are no more rows for the resultset represented by the <i><tt class="parameter">result</tt></i> parameter. </p> <p class="para"> <b>mysqli_fetch_array()</b> is an extended version of the <a href="mysqli-result.fetch-row.html" class="function">mysqli_fetch_row()</a> function. In addition to storing the data in the numeric indices of the result array, the <b>mysqli_fetch_array()</b> function can also store the data in associative indices, using the field names of the result set as keys. </p> <blockquote><p><b class="note">Note</b>: <span class="simpara">Field names returned by this functionare <em class="emphasis">case-sensitive</em>.</span></p></blockquote> <blockquote><p><b class="note">Note</b>: <span class="simpara">This function sets NULL fields tothe PHP <b><tt>NULL</tt></b> value.</span></p></blockquote> <p class="para"> 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. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt><span class="term"><i><tt class="parameter">result</tt></i></span><dd><p class="para">Procedural style only: A result setidentifier returned by <a href="mysqli.query.html" class="function">mysqli_query()</a>, <a href="mysqli.store-result.html" class="function">mysqli_store_result()</a>or <a href="mysqli.use-result.html" class="function">mysqli_use_result()</a>.</p></dd></dt> <dt> <span class="term"><i><tt class="parameter">resulttype</tt></i></span> <dd> <p class="para"> This optional parameter is a constant indicating what type of array should be produced from the current row data. The possible values for
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?