php-doc-en/reference/sybase/functions/sybase-fetch-object.xml
Maciej Sobaczewski 8b5940cade Remove changelogs for PHP 4 - 2nd round
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@334605 c90b9560-bf6c-de11-be94-00142212c4b1
2014-08-26 14:28:17 +00:00

116 lines
2.9 KiB
XML

<?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="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
-->