mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 22:08:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@307573 c90b9560-bf6c-de11-be94-00142212c4b1
122 lines
3.3 KiB
XML
122 lines
3.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<refentry xml:id="function.cubrid-fetch-object" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>cubrid_fetch_object</refname>
|
|
<refpurpose>Returns an object with the column names</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>cubrid_fetch_object</methodname>
|
|
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>class_name</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter>params</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
This function returns an object with the column names of the result set as properties. The values of these properties are extracted from the current row of the result.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>result</parameter></term>
|
|
<listitem><para><parameter>result</parameter> comes from a call to <function>cubrid_execute</function></para></listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>class_name</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
The name of the class to instantiate, set the properties of and return.
|
|
If not specified, a <classname>stdClass</classname> object is returned.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>params</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
An optional <type>array</type> of parameters to pass to the constructor
|
|
for <parameter>class_name</parameter> objects.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
An object, when process is successful.
|
|
</para>
|
|
<para>
|
|
&false; on failure.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title><function>cubrid_fetch_object</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$link = cubrid_connect("localhost", 30000, "demodb2", "dba", "");
|
|
if (!$link)
|
|
{
|
|
die('Could not connect.');
|
|
}
|
|
$query = 'SELECT name, address, salary FROM employees';
|
|
$result = cubrid_execute($link, $query);
|
|
if ($result)
|
|
{
|
|
$row = cubrid_fetch_object($result);
|
|
echo $row->name."<BR>";
|
|
echo $row->address."<BR>";
|
|
echo $row->salary;
|
|
|
|
cubrid_close_request($result);
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
Result:
|
|
Peter
|
|
1st Avenue, New York
|
|
1000.0000000000000000
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</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
|
|
-->
|