<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.uodbc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.odbc-fetch-object.php',
    1 => 'odbc_fetch_object',
    2 => 'Fetch a result row as an object',
  ),
  'up' => 
  array (
    0 => 'ref.uodbc.php',
    1 => 'ODBC Functions',
  ),
  'prev' => 
  array (
    0 => 'function.odbc-fetch-into.php',
    1 => 'odbc_fetch_into',
  ),
  'next' => 
  array (
    0 => 'function.odbc-fetch-row.php',
    1 => 'odbc_fetch_row',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/uodbc/functions/odbc-fetch-object.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.odbc-fetch-object" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">odbc_fetch_object</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.2, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">odbc_fetch_object</span> &mdash; <span class="dc-title">Fetch a result row as an object</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.odbc-fetch-object-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>odbc_fetch_object</strong></span>(<span class="methodparam"><span class="type">Odbc\Result</span> <code class="parameter">$statement</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$row</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="class.stdclass.php" class="type stdClass">stdClass</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Fetch an <span class="type"><a href="language.types.object.php" class="type object">object</a></span> from an ODBC query.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.odbc-fetch-object-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">statement</code></dt>
     <dd>
      <p class="para">
       The ODBC result object from <span class="function"><a href="function.odbc-exec.php" class="function">odbc_exec()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">row</code></dt>
     <dd>
      <p class="para">
       Optionally choose which row number to retrieve.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.odbc-fetch-object-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns an object that corresponds to the fetched row, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if there 
   are no more rows.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.odbc-fetch-object-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>
  <code class="parameter">statement</code> expects an <span class="classname"><strong class="classname">Odbc\Result</strong></span>
  instance now; previously, a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

     <tr>
      <td>8.4.0</td>
      <td>
       <code class="parameter">row</code> is now nullable.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 notes" id="refsect1-function.odbc-fetch-object-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    This function exists when compiled with DBMaker, IBM DB2 or UnixODBC support.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.odbc-fetch-object-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.odbc-fetch-row.php" class="function" rel="rdfs-seeAlso">odbc_fetch_row()</a> - Fetch a row</span></li>
    <li><span class="function"><a href="function.odbc-fetch-array.php" class="function" rel="rdfs-seeAlso">odbc_fetch_array()</a> - Fetch a result row as an associative array</span></li>
    <li><span class="function"><a href="function.odbc-num-rows.php" class="function" rel="rdfs-seeAlso">odbc_num_rows()</a> - Number of rows in a result</span></li>
   </ul>
  </p>
 </div>

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