result no longer passes by reference at call time as of PHP 4.2.0 which

closes bug #21813.  Also added an example.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@113009 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2003-01-22 07:08:15 +00:00
parent a59199d915
commit 3f1ae92e57

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/oci8.xml, last change in rev 1.2 -->
<refentry id="function.ocifetchinto">
<refnamediv>
@ -11,7 +11,7 @@
<methodsynopsis>
<type>int</type><methodname>OCIFetchInto</methodname>
<methodparam><type>int</type><parameter>stmt</parameter></methodparam>
<methodparam><type>array &amp;</type><parameter>result</parameter></methodparam>
<methodparam><type>array </type><parameter>result</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
@ -22,11 +22,20 @@
<parameter>result</parameter> will contain a zero-based array of all
columns that are not &null;.
</para>
<para>
The <parameter>mode</parameter> parameter allows you to change the
default behaviour. You can specify more than one flag by simply
adding them up (eg OCI_ASSOC+OCI_RETURN_NULLS). The known flags
are:
<note>
<para>
Prior to PHP 4.2.0, the <parameter>result</parameter> parameter is
passed in by reference at call time. So in these older versions of
PHP you'd use <varname>&$row</varname> in our example below. See
also <link linkend="ini.allow-call-time-pass-reference">
allow_call_time_pass_reference</link>.
</para>
</note>
<para>
The <parameter>mode</parameter> parameter allows you to change the
default behaviour. You can specify more than one flag by simply
adding them up (eg OCI_ASSOC+OCI_RETURN_NULLS). The known flags
are:
<simplelist>
<member>
<literal>OCI_ASSOC</literal> Return an associative array.
@ -43,7 +52,31 @@
instead of the descriptor.
</member>
</simplelist>
</para>
</para>
<para>
<example>
<title>A simple <function>OCIFetchInto</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$conn = ocilogon("username","password");
$query = "SELECT apples FROM oranges";
$statement = OCIParse ($conn, $query);
OCIExecute ($statement);
while (OCIFetchInto ($statement, $row, OCI_ASSOC)) {
print $row['apples'];
}
?>
]]>
</programlisting>
</example>
</para>
<para>
See also <function>OCIExecute</function>.
</para>
</refsect1>
</refentry>