mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
a59199d915
commit
3f1ae92e57
1 changed files with 41 additions and 8 deletions
|
@ -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 &</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>
|
||||
|
||||
|
|
Loading…
Reference in a new issue