<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pgsql.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.pg-field-num.php',
    1 => 'pg_field_num',
    2 => 'Liefert die Feldnummer des angegebenen Feldes',
  ),
  'up' => 
  array (
    0 => 'ref.pgsql.php',
    1 => 'PostgreSQL-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.pg-field-name.php',
    1 => 'pg_field_name',
  ),
  'next' => 
  array (
    0 => 'function.pg-field-prtlen.php',
    1 => 'pg_field_prtlen',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/pgsql/functions/pg-field-num.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pg-field-num" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pg_field_num</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pg_field_num</span> &mdash; <span class="dc-title">Liefert die Feldnummer des angegebenen Feldes</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pg-field-num-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pg_field_num</strong></span>(<span class="methodparam"><span class="type"><a href="class.pgsql-result.php" class="type PgSql\Result">PgSql\Result</a></span> <code class="parameter">$result</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$field</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>pg_field_num()</strong></span> gibt die Nummer des Feldes zurück, das
   dem angegebenen Feld <code class="parameter">field</code> in der durch
   <code class="parameter">result</code> bezeichneten Instanz entspricht.
  </p>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">
    Diese Funktion ersetzt die Funktion <span class="function"><strong>pg_fieldnum()</strong></span>.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pg-field-num-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">result</code></dt>
     <dd>
      <p class="para">Eine <span class="classname"><a href="class.pgsql-result.php" class="classname">PgSql\Result</a></span>-Instanz, die von <span class="function"><a href="function.pg-query.php" class="function">pg_query()</a></span>,
<span class="function"><a href="function.pg-query-params.php" class="function">pg_query_params()</a></span> oder <span class="function"><a href="function.pg-execute.php" class="function">pg_execute()</a></span> (unter anderen) zurückgegeben wurde.</p>
     </dd>
    
    
     <dt><code class="parameter">field</code></dt>
      <dd>
       <p class="para">
        Der Name des Feldes. Der angegebene Name wird wie ein Bezeichner in
        einem SQL-Befehl behandelt, d. h. wenn er nicht in doppelten
        Anführungszeichen steht, wird er in Kleinschreibung umgewandelt.
       </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pg-field-num-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Die Feldnummer (beginnend bei 0) oder -1, falls ein Fehler auftrat.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.pg-field-num-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  Der Parameter <code class="parameter">result</code> erwartet nun eine <span class="classname"><a href="class.pgsql-result.php" class="classname">PgSql\Result</a></span>-Instanz;
  vorher wurde eine <a href="language.types.resource.php" class="link">Ressource</a> erwartet.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.pg-field-num-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Die Nummer eines Feldes ermitteln</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />  $dbconn </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">"dbname=publisher"</span><span style="color: #007700">) or die<br />            (</span><span style="color: #DD0000">"Konnte keine Verbindung aufbauen."</span><span style="color: #007700">);<br /><br />  </span><span style="color: #0000BB">$res </span><span style="color: #007700">= </span><span style="color: #0000BB">pg_query</span><span style="color: #007700">(</span><span style="color: #0000BB">$dbconn</span><span style="color: #007700">, </span><span style="color: #DD0000">"select author, year, title from authors where author = 'Orwell'"</span><span style="color: #007700">);<br /><br />  echo </span><span style="color: #DD0000">"Die Spalte 'title' hat die Feldnummer: "</span><span style="color: #007700">, </span><span style="color: #0000BB">pg_field_num</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">, </span><span style="color: #DD0000">'title'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Die Spalte &#039;title&#039; hat die Feldnummer: 2</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.pg-field-num-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.pg-field-name.php" class="function" rel="rdfs-seeAlso">pg_field_name()</a> - Liefert den Namen eines Feldes</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>