reference/pgsql/functions/pg-fetch-array.xml
cfeb14a38b666f6a3fc73da70f4a90fbe115e53f
...
...
@@ -1,6 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.pg-fetch-array">
3
+
<refentry xml:id="function.pg-fetch-array" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>pg_fetch_array</refname>
6
6
<refpurpose>Fetch a row as an array</refpurpose>
...
...
@@ -9,10 +9,10 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>array</type><methodname>pg_fetch_array</methodname>
13
-
<methodparam><type>resource</type><parameter>result</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>row</parameter></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>result_type</parameter><initializer>PGSQL_BOTH</initializer></methodparam>
12
+
<type class="union"><type>array</type><type>false</type></type><methodname>pg_fetch_array</methodname>
13
+
<methodparam><type>PgSql\Result</type><parameter>result</parameter></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>row</parameter><initializer>&null;</initializer></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>mode</parameter><initializer><constant>PGSQL_BOTH</constant></initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
<function>pg_fetch_array</function> returns an array that
...
...
@@ -23,7 +23,7 @@
23
23
<function>pg_fetch_row</function>. In addition to storing the
24
24
data in the numeric indices (field number) to the result array, it
25
25
can also store the data using associative indices (field name).
26
-
It stores both indicies by default.
26
+
It stores both indices by default.
27
27
</para>
28
28
&database.fetch-null;
29
29
<para>
...
...
@@ -40,11 +40,7 @@
40
40
<varlistentry>
41
41
<term><parameter>result</parameter></term>
42
42
<listitem>
43
-
<para>
44
-
PostgreSQL query result resource, returned by <function>pg_query</function>,
45
-
<function>pg_query_params</function> or <function>pg_execute</function>
46
-
(among others).
47
-
</para>
43
+
&pgsql.parameter.result;
48
44
</listitem>
49
45
</varlistentry>
50
46
<varlistentry>
...
...
@@ -57,20 +53,9 @@
57
53
</listitem>
58
54
</varlistentry>
59
55
<varlistentry>
60
-
<term><parameter>result_type</parameter></term>
56
+
<term><parameter>mode</parameter></term>
61
57
<listitem>
62
-
<para>
63
-
An optional parameter that controls
64
-
how the returned <type>array</type> is indexed.
65
-
<parameter>result_type</parameter> is a constant and can take the
66
-
following values: <constant>PGSQL_ASSOC</constant>,
67
-
<constant>PGSQL_NUM</constant> and <constant>PGSQL_BOTH</constant>.
68
-
Using <constant>PGSQL_NUM</constant>, <function>pg_fetch_array</function>
69
-
will return an array with numerical indices, using
70
-
<constant>PGSQL_ASSOC</constant> it will return only associative indices
71
-
while <constant>PGSQL_BOTH</constant>, the default, will return both
72
-
numerical and associative indices.
73
-
</para>
58
+
&pgsql.parameter.mode;
74
59
</listitem>
75
60
</varlistentry>
76
61
</variablelist>
...
...
@@ -89,9 +74,27 @@
89
74
<para>
90
75
&false; is returned if <parameter>row</parameter> exceeds the number
91
76
of rows in the set, there are no more rows, or on any other error.
77
+
Fetching from the result of a query other than SELECT will also return &false;.
92
78
</para>
93
79
</refsect1>
94
80

81
+
<refsect1 role="changelog">
82
+
&reftitle.changelog;
83
+
<informaltable>
84
+
<tgroup cols="2">
85
+
<thead>
86
+
<row>
87
+
<entry>&Version;</entry>
88
+
<entry>&Description;</entry>
89
+
</row>
90
+
</thead>
91
+
<tbody>
92
+
&pgsql.changelog.result-object;
93
+
</tbody>
94
+
</tgroup>
95
+
</informaltable>
96
+
</refsect1>
97
+

95
98
<refsect1 role="examples">
96
99
&reftitle.examples;
97
100
<para>
...
...
@@ -147,7 +150,6 @@ echo $arr[1] . " <- Row 3 E-mail\n";
147
150
</refsect1>
148
151

149
152
</refentry>
150
-

151
153
<!-- Keep this comment at the end of the file
152
154
Local variables:
153
155
mode: sgml
154
156