<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.dba.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.dba-fetch.php',
    1 => 'dba_fetch',
    2 => 'Fetch data specified by key',
  ),
  'up' => 
  array (
    0 => 'ref.dba.php',
    1 => 'DBA Functions',
  ),
  'prev' => 
  array (
    0 => 'function.dba-exists.php',
    1 => 'dba_exists',
  ),
  'next' => 
  array (
    0 => 'function.dba-firstkey.php',
    1 => 'dba_firstkey',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/dba/functions/dba-fetch.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.dba-fetch" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">dba_fetch</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">dba_fetch</span> &mdash; <span class="dc-title">Fetch data specified by key</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.dba-fetch-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>dba_fetch</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.array.php" class="type array">array</a></span></span> <code class="parameter">$key</code></span>, <span class="methodparam"><span class="type"><a href="class.dba-connection.php" class="type Dba\Connection">Dba\Connection</a></span> <code class="parameter">$dba</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$skip</code><span class="initializer"> = 0</span></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   Overloaded signature deprecated as of 8.3.0:
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>dba_fetch</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.array.php" class="type array">array</a></span></span> <code class="parameter">$key</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$skip</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$dba</code></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="simpara">
   <span class="function"><strong>dba_fetch()</strong></span> fetches the data specified by
   <code class="parameter">key</code> from the database specified with
   <code class="parameter">dba</code>.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.dba-fetch-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">key</code></dt>
    <dd>
     <span class="simpara">
      The key the data is specified by.
     </span>
     <blockquote class="note"><p><strong class="note">Note</strong>: 
      <span class="simpara">
       When working with inifiles this function accepts arrays as keys
       where index 0 is the group and index 1 is the value name. See:
       <span class="function"><a href="function.dba-key-split.php" class="function">dba_key_split()</a></span>.
      </span>
     </p></blockquote>
    </dd>
   
   
    <dt><code class="parameter">dba</code></dt>
    <dd>
     <span class="simpara">
      A <span class="classname"><a href="class.dba-connection.php" class="classname">Dba\Connection</a></span> instance, returned by <span class="function"><a href="function.dba-open.php" class="function">dba_open()</a></span> or <span class="function"><a href="function.dba-popen.php" class="function">dba_popen()</a></span>.
     </span>
    </dd>
   
   
    <dt><code class="parameter">skip</code></dt>
    <dd>
     <span class="simpara">
      The number of key-value pairs to ignore when using cdb databases.
      This value is ignored for all other databases which do not support
      multiple keys with the same name.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.dba-fetch-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns the associated string if the key/data pair is found, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
   otherwise.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.dba-fetch-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.4.0</td>
 <td>
  The <code class="parameter">dba</code> parameter expects a <span class="classname"><a href="class.dba-connection.php" class="classname">Dba\Connection</a></span>
  instance now; previously, a valid <code class="literal">dba</code> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

     <tr>
      <td>8.3.0</td>
      <td>
       Calling <span class="function"><strong>dba_fetch()</strong></span> with <code class="parameter">dba</code> as
       the 3rd argument is now deprecated.
      </td>
     </tr>

     <tr>
      <td>8.2.0</td>
      <td>
       <span class="function"><strong>dba_fetch()</strong></span>&#039;s optional skip argument is now at the end
       in line with PHP userland semantics. The previously overloaded signature
       is still accepted but discouraged.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.dba-fetch-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.dba-exists.php" class="function" rel="rdfs-seeAlso">dba_exists()</a> - Check whether key exists</span></li>
   <li><span class="function"><a href="function.dba-delete.php" class="function" rel="rdfs-seeAlso">dba_delete()</a> - Delete DBA entry specified by key</span></li>
   <li><span class="function"><a href="function.dba-insert.php" class="function" rel="rdfs-seeAlso">dba_insert()</a> - Insert entry</span></li>
   <li><span class="function"><a href="function.dba-replace.php" class="function" rel="rdfs-seeAlso">dba_replace()</a> - Replace or insert entry</span></li>
   <li><span class="function"><a href="function.dba-key-split.php" class="function" rel="rdfs-seeAlso">dba_key_split()</a> - Splits a key in string representation into array representation</span></li>
  </ul>
 </div>

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