<!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><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.fbsql-field-len.html">fbsql_field_len</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.fbsql-field-seek.html">fbsql_field_seek</a></div> <div class="up"><a href="ref.fbsql.html">FrontBase Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><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)</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">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">string</span> <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> ] )</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">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">result</code></em></span> <dd> <p class="para"> A result pointer returned by <span class="function"><a href="function.fbsql-list-fields.html" class="function">fbsql_list_fields()</a></span>. </p> </dd> </dt> <dt> <span class="term"><em><code class="parameter">field_index</code></em></span> <dd> <p class="para"> The numerical offset of the field. The field index starts at 0. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.fbsql-field-name-returnvalues"> <h3 class="title">Return Values</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">Examples</h3> <p class="para"> <div class="example" id="example-1127"> <p><strong>Example #1 <span class="function"><strong>fbsql_field_name()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><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> </code></div> </div> <div class="example-contents"><p>The above example will output:</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">See Also</h3> <p class="para"> <ul class="simplelist"> <li class="member"> <span class="function"><a href="function.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><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.fbsql-field-len.html">fbsql_field_len</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.fbsql-field-seek.html">fbsql_field_seek</a></div> <div class="up"><a href="ref.fbsql.html">FrontBase Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>