mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 22:06:57 +08:00
90 lines
3.9 KiB
HTML
90 lines
3.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>Returns the number of columns in the query</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.ifx-num-fields" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">ifx_num_fields</h1>
|
|
<p class="verinfo">(PHP 4, PHP 5 < 5.2.1)</p><p class="refpurpose"><span class="refname">ifx_num_fields</span> — <span class="dc-title">Returns the number of columns in the query</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.ifx-num-fields-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>ifx_num_fields</strong></span>
|
|
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result_id</code></span>
|
|
) : <span class="type">int</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
After preparing or executing a query, this call gives you the
|
|
number of columns in the query.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.ifx-num-fields-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">result_id</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
<code class="parameter">result_id</code> is a valid resultid returned by
|
|
<span class="function"><a href="ifx_query.html" class="function">ifx_query()</a></span> or
|
|
<span class="function"><a href="ifx_prepare.html" class="function">ifx_prepare()</a></span> (select type queries only!).
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.ifx-num-fields-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns the number of columns in query for
|
|
<code class="parameter">result_id</code>, or <strong><code>FALSE</code></strong> on errors.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.ifx-num-fields-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-1292">
|
|
<p><strong>Example #1 <span class="function"><strong>ifx_num_fields()</strong></span> Example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br />$conn_id </span><span style="color: #007700">= </span><span style="color: #0000BB">ifx_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"db"</span><span style="color: #007700">, </span><span style="color: #DD0000">"user"</span><span style="color: #007700">, </span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$res_id </span><span style="color: #007700">= </span><span style="color: #0000BB">ifx_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"select * from systables"</span><span style="color: #007700">, </span><span style="color: #0000BB">$conn_id</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">ifx_num_fields</span><span style="color: #007700">(</span><span style="color: #0000BB">$res_id</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.ifx-num-fields-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="ifx_num_rows.html" class="function" rel="rdfs-seeAlso">ifx_num_rows()</a> - Count the rows already fetched from a query</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |