php-doc-en/reference/ingres-ii/functions/ingres-fetch-object.xml

88 lines
2.7 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/ingres_ii.xml, last change in rev 1.1 -->
<refentry id="function.ingres-fetch-object">
<refnamediv>
<refname>ingres_fetch_object</refname>
<refpurpose>Fetch a row of result into an object.</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>object</type><methodname>ingres_fetch_object</methodname>
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter></methodparam>
<methodparam choice="opt"><type>resource</type><parameter>link</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
<para>
<function>ingres_fetch_object</function> Returns an object that
corresponds to the fetched row, or &false; if there are no more
rows.
</para>
<para>
This function is similar to
<function>ingres_fetch_array</function>, with one difference - an
object is returned, instead of an array. Indirectly, that means
that you can only access the data by the field names, and not by
their offsets (numbers are illegal property names).
</para>
<para>
The optional argument <parameter>result_type</parameter> is a
constant and can take the following values: INGRES_ASSOC,
INGRES_NUM, and INGRES_BOTH.
</para>
<para>
Speed-wise, the function is identical to
<function>ingres_fetch_array</function>, and almost as quick as
<function>ingres_fetch_row</function> (the difference is
insignificant).
</para>
<para>
<example>
<title><function>ingres_fetch_object</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
ingres_connect ($database, $user, $password);
ingres_query ("select * from table");
while ($row = ingres_fetch_object()) {
echo $row->user_id;
echo $row->fullname;
}
?>
]]>
</programlisting>
</example>
</para>
<para>
See also
<function>ingres_query</function>,
<function>ingres_num_fields</function>,
<function>ingres_field_name</function>,
<function>ingres_fetch_array</function>, and
<function>ingres_fetch_row</function>.
</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:"../../../../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
-->