mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-18 22:06:57 +08:00
106 lines
4.5 KiB
HTML
106 lines
4.5 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>Get the name of the specified field in a result</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.fbsql-field-name" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">fbsql_field_name</h1>
|
|
<p class="verinfo">(PHP 4 >= 4.0.6, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">fbsql_field_name</span> — <span class="dc-title">Get the name of the specified field in a result</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.fbsql-field-name-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>fbsql_field_name</strong></span>
|
|
( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$result</code></span>
|
|
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$field_index</code></span>
|
|
] ) : <span class="type">string</span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
Returns the name of the specified field index.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.fbsql-field-name-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">result</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
A result pointer returned by <span class="function"><a href="fbsql_list_fields.html" class="function">fbsql_list_fields()</a></span>.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">field_index</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
The numerical offset of the field. The field index starts at 0.
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.fbsql-field-name-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
Returns the name as a string, or <strong><code>FALSE</code></strong> if the field doesn't exist.
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.fbsql-field-name-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-1217">
|
|
<p><strong>Example #1 <span class="function"><strong>fbsql_field_name()</strong></span> example</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// The users table consists of three fields:<br />// user_id<br />// username<br />// password.<br /><br /></span><span style="color: #0000BB">$res </span><span style="color: #007700">= </span><span style="color: #0000BB">fbsql_db_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"users"</span><span style="color: #007700">, </span><span style="color: #DD0000">"select * from users"</span><span style="color: #007700">, </span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">fbsql_field_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />echo </span><span style="color: #0000BB">fbsql_field_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">, </span><span style="color: #0000BB">2</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程会输出:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
user_id
|
|
password
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.fbsql-field-name-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="fbsql_field_type.html" class="function" rel="rdfs-seeAlso">fbsql_field_type()</a> - Get the type of the specified field in a result</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
</div></div></div></body></html> |