<?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> <refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.sybase-fetch-object"> <refnamediv> <refname>sybase_fetch_object</refname> <refpurpose>Fetch a row as an object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>object</type><methodname>sybase_fetch_object</methodname> <methodparam><type>resource</type><parameter>result</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>object</parameter></methodparam> </methodsynopsis> <para> <function>sybase_fetch_object</function> is similar to <function>sybase_fetch_assoc</function>, with one difference - an object is returned, instead of an array. </para> <para> Speed-wise, the function is identical to <function>sybase_fetch_array</function>, and almost as quick as <function>sybase_fetch_row</function> (the difference is insignificant). </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>result</parameter></term> <listitem> <para> </para> </listitem> </varlistentry> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> Use the second <parameter>object</parameter> to specify the type of object you want to return. If this parameter is omitted, the object will be of type stdClass. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an object with properties that correspond to the fetched row, or &false; if there are no more rows. </para> </refsect1> <refsect1 role="changelog"> &reftitle.changelog; <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>&Version;</entry> <entry>&Description;</entry> </row> </thead> <tbody> <row> <entry>4.3.0</entry> <entry><para> This function will no longer return numeric object members. Old behaviour: <screen> <![CDATA[ object(stdclass)(3) { [0]=> string(3) "foo" ["foo"]=> string(3) "foo" [1]=> string(3) "bar" ["bar"]=> string(3) "bar" } ]]> </screen> New behaviour: <screen> <![CDATA[ object(stdclass)(3) { ["foo"]=> string(3) "foo" ["bar"]=> string(3) "bar" } ]]> </screen> </para> </entry> </row> </tbody> </tgroup> </informaltable> </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>sybase_fetch_object</function> return as Foo</title> <programlisting role="php"> <![CDATA[ <?php class Foo { var $foo, $bar, $baz; } // {...] $qrh= sybase_query('SELECT foo, bar, baz FROM example'); $foo= sybase_fetch_object($qrh, 'Foo'); $bar= sybase_fetch_object($qrh, new Foo()); // {...] ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>sybase_fetch_array</function></member> <member><function>sybase_fetch_row</function></member> </simplelist> </para> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->