uTools-Manuals/docs/php/fbsql_table_name.html
2019-04-08 23:22:26 +08:00

94 lines
4.7 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 table name of field</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.fbsql-table-name" class="refentry">
<div class="refnamediv">
<h1 class="refname">fbsql_table_name</h1>
<p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">fbsql_table_name</span> &mdash; <span class="dc-title">Get table name of field</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.fbsql-table-name-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>fbsql_table_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">$index</code></span>
) : <span class="type">string</span></div>
<p class="para rdfs-comment">
<span class="function"><strong>fbsql_table_name()</strong></span> gets the name of the current table in
the given <code class="parameter">result</code> set.
</p>
<p class="para">
The <span class="function"><a href="fbsql_num_rows.html" class="function">fbsql_num_rows()</a></span> function may be used to determine
the number of tables in the result pointer.
</p>
</div>
<div class="refsect1 parameters" id="refsect1-function.fbsql-table-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_tables.html" class="function">fbsql_list_tables()</a></span>.
</p>
</dd>
<dt>
<code class="parameter">index</code></dt>
<dd>
<p class="para">
Integer index for the current table.
</p>
</dd>
</dl>
</p>
</div>
<div class="refsect1 returnvalues" id="refsect1-function.fbsql-table-name-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
Returns the name of the table, as a string.
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.fbsql-table-name-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-1227">
<p><strong>Example #1 <span class="function"><strong>fbsql_table_name()</strong></span> example</strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />fbsql_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"localhost"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"_SYSTEM"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fbsql_list_tables</span><span style="color: #007700">(</span><span style="color: #DD0000">"wisconsin"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">;<br />while&nbsp;(</span><span style="color: #0000BB">$i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #0000BB">fbsql_num_rows</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$tb_names</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #0000BB">fbsql_table_name</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$tb_names</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">]&nbsp;.&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$i</span><span style="color: #007700">++;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
</div>
</p>
</div>
</div></div></div></body></html>