reference/oci8/functions/oci-result.xml
5e41012cfdf8f2eff5fa56de446c7656afac536c
...
...
@@ -11,10 +11,10 @@
11
11
<methodsynopsis>
12
12
<type>mixed</type><methodname>oci_result</methodname>
13
13
<methodparam><type>resource</type><parameter>statement</parameter></methodparam>
14
-
<methodparam><type>mixed</type><parameter>field</parameter></methodparam>
14
+
<methodparam><type class="union"><type>string</type><type>int</type></type><parameter>column</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
-
Returns the data from <parameter>field</parameter> in the current row,
17
+
Returns the data from <parameter>column</parameter> in the current row,
18
18
fetched by <function>oci_fetch</function>.
19
19
</para>
20
20
&oci.datatypes;
...
...
@@ -32,11 +32,13 @@
32
32
</listitem>
33
33
</varlistentry>
34
34
<varlistentry>
35
-
<term><parameter>field</parameter></term>
35
+
<term><parameter>column</parameter></term>
36
36
<listitem>
37
37
<para>
38
-
Can be either use the column number (1-based) or the column name (in
39
-
uppercase).
38
+
Can be either use the column number (1-based) or the column name.
39
+
The case of the column name must be the case that Oracle meta data
40
+
describes the column as, which is uppercase for columns created
41
+
case insensitively.
40
42
</para>
41
43
</listitem>
42
44
</varlistentry>
...
...
@@ -52,16 +54,42 @@
52
54
</para>
53
55
</refsect1>
54
56

55
-
<refsect1 role="notes">
56
-
&reftitle.notes;
57
-
<note>
58
-
<para>
59
-
In PHP versions before 5.0.0 you must use <function>ociresult</function> instead.
60
-
This name still can be used, it was left as alias of
61
-
<function>oci_result</function> for downwards compatability.
62
-
This, however, is deprecated and not recommended.
63
-
</para>
64
-
</note>
57
+
<refsect1 role="examples">
58
+
&reftitle.examples;
59
+
<para>
60
+
<example>
61
+
<title><function>oci_fetch</function> with <function>oci_result</function></title>
62
+
<programlisting role="php">
63
+
<![CDATA[
64
+
<?php
65
+

66
+
$conn = oci_connect('hr', 'welcome', 'localhost/XE');
67
+
if (!$conn) {
68
+
$e = oci_error();
69
+
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
70
+
}
71
+

72
+
$sql = 'SELECT location_id, city FROM locations WHERE location_id < 1200';
73
+
$stid = oci_parse($conn, $sql);
74
+
oci_execute($stid);
75
+

76
+
while (oci_fetch($stid)) {
77
+
echo oci_result($stid, 'LOCATION_ID') . " is ";
78
+
echo oci_result($stid, 'CITY') . "<br>\n";
79
+
}
80
+

81
+
// Displays:
82
+
// 1000 is Roma
83
+
// 1100 is Venice
84
+

85
+
oci_free_statement($stid);
86
+
oci_close($conn);
87
+

88
+
?>
89
+
]]>
90
+
</programlisting>
91
+
</example>
92
+
</para>
65
93
</refsect1>
66
94

67
95
<refsect1 role="seealso">
...
...
@@ -78,7 +106,6 @@
78
106
</refsect1>
79
107

80
108
</refentry>
81
-

82
109
<!-- Keep this comment at the end of the file
83
110
Local variables:
84
111
mode: sgml
85
112