function.maxdb-fetch-array.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 145 行 · 第 1/2 页

HTML
145
字号
<!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="function.maxdb-execute.html">maxdb_execute</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.maxdb-fetch-assoc.html">maxdb_fetch_assoc</a></div> <div class="up"><a href="ref.maxdb.html">MaxDB Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.maxdb-fetch-array" class="refentry"> <div class="refnamediv">  <h1 class="refname">maxdb_fetch_array</h1>  <h1 class="refname">result-&gt;fetch_array</h1>  <p class="verinfo">(PECL maxdb:1.0-7.6.00.38)</p><p class="refpurpose"><span class="refname">maxdb_fetch_array</span> -- <span class="refname">result-&gt;fetch_array</span> &mdash; <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">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>maxdb_fetch_array</b></b></span>    ( <span class="methodparam"><span class="type">resource</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">Object oriented style (method):</p>  <div class="classsynopsis">   <div class="ooclass"><b class="classname">result</b></div>   <div class="methodsynopsis dc-description">    <span class="type">mixed</span>     <span class="methodname"><b><b>fetch_array</b></b></span>     ([ <span class="methodparam"><span class="type">int</span> <tt class="parameter">$resulttype</tt></span>   ] )</div>  </div>  <p class="para">   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>maxdb_fetch_array()</b> is an extended version of the   <a href="function.maxdb-fetch-row.html" class="function">maxdb_fetch_row()</a> function. In addition to storing the data in the   numeric indices of the result array, the <b>maxdb_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>  <p class="para">   The optional second argument <i><tt class="parameter">resulttype</tt></i> 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 MAXDB_ASSOC, MAXDB_ASSOC_UPPER, MAXDB_ASSOC_LOWER, MAXDB_NUM, or MAXDB_BOTH.   By default the   <b>maxdb_fetch_array()</b> function will assume MAXDB_BOTH, which is a combination of   MAXDB_NUM and MAXDB_ASSOC  for this parameter.  </p>  <p class="para">   By using the MAXDB_ASSOC constant this function will behave identically to the   <a href="function.maxdb-fetch-assoc.html" class="function">maxdb_fetch_assoc()</a>, while MAXDB_NUM will behave identically to the   <a href="function.maxdb-fetch-row.html" class="function">maxdb_fetch_row()</a> function. The final option MAXDB_BOTH will create a single   array with the attributes of both.  </p>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?