reference/pdo/pdostatement/fetchcolumn.xml
28529d3539b850e870e3aa97570f4db0e53daa03
...
...
@@ -10,9 +10,9 @@
10
10

11
11
<refsect1 role="description">
12
12
&reftitle.description;
13
-
<methodsynopsis>
13
+
<methodsynopsis role="PDOStatement">
14
14
<modifier>public</modifier> <type>mixed</type><methodname>PDOStatement::fetchColumn</methodname>
15
-
<methodparam choice="opt"><type>int</type><parameter>column_number</parameter><initializer>0</initializer></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>column</parameter><initializer>0</initializer></methodparam>
16
16
</methodsynopsis>
17
17

18
18
<para>
...
...
@@ -22,10 +22,10 @@
22
22

23
23
<note>
24
24
<para>
25
-
<function>PDOStatement::fetchColumn</function> should not be used to
25
+
<methodname>PDOStatement::fetchColumn</methodname> should not be used to
26
26
retrieve boolean columns, as it is impossible to distinguish a value of
27
27
&false; from there being no more rows to retrieve. Use
28
-
<function>PDOStatement::fetch</function> instead.
28
+
<methodname>PDOStatement::fetch</methodname> instead.
29
29
</para>
30
30
</note>
31
31
</refsect1>
...
...
@@ -35,11 +35,11 @@
35
35
<para>
36
36
<variablelist>
37
37
<varlistentry>
38
-
<term><parameter>column_number</parameter></term>
38
+
<term><parameter>column</parameter></term>
39
39
<listitem>
40
40
<para>
41
41
0-indexed number of the column you wish to retrieve from the row. If
42
-
no value is supplied, <function>PDOStatement::fetchColumn</function>
42
+
no value is supplied, <methodname>PDOStatement::fetchColumn</methodname>
43
43
fetches the first column.
44
44
</para>
45
45
</listitem>
...
...
@@ -51,17 +51,22 @@
51
51
<refsect1 role="returnvalues">
52
52
&reftitle.returnvalues;
53
53
<para>
54
-
<function>PDOStatement::fetchColumn</function> returns a single column
55
-
in the next row of a result set.
54
+
<methodname>PDOStatement::fetchColumn</methodname> returns a single column
55
+
from the next row of a result set or &false; if there are no more rows.
56
56
</para>
57
57
<warning>
58
58
<para>
59
59
There is no way to return another column from the same row if you
60
-
use <function>PDOStatement::fetchColumn</function> to retrieve data.
60
+
use <methodname>PDOStatement::fetchColumn</methodname> to retrieve data.
61
61
</para>
62
62
</warning>
63
63
</refsect1>
64
64

65
+
<refsect1 role="errors">
66
+
&reftitle.errors;
67
+
&pdo.errors;
68
+
</refsect1>
69
+

65
70
<refsect1 role="examples">
66
71
&reftitle.examples;
67
72
<para>
...
...
@@ -72,13 +77,13 @@
72
77
$sth = $dbh->prepare("SELECT name, colour FROM fruit");
73
78
$sth->execute();
74
79

75
-
print("Fetch the first column from the first row in the result set:\n");
80
+
print "Fetch the first column from the first row in the result set:\n";
76
81
$result = $sth->fetchColumn();
77
-
print("name = $result\n");
82
+
print "name = $result\n";
78
83

79
-
print("Fetch the second column from the second row in the result set:\n");
84
+
print "Fetch the second column from the second row in the result set:\n";
80
85
$result = $sth->fetchColumn(1);
81
-
print("colour = $result\n");
86
+
print "colour = $result\n";
82
87
?>
83
88
]]>
84
89
</programlisting>
...
...
@@ -99,16 +104,15 @@ colour = red
99
104
&reftitle.seealso;
100
105
<para>
101
106
<simplelist>
102
-
<member><function>PDO::query</function></member>
103
-
<member><function>PDOStatement::fetch</function></member>
104
-
<member><function>PDOStatement::fetchAll</function></member>
105
-
<member><function>PDO::prepare</function></member>
106
-
<member><function>PDOStatement::setFetchMode</function></member>
107
+
<member><methodname>PDO::query</methodname></member>
108
+
<member><methodname>PDOStatement::fetch</methodname></member>
109
+
<member><methodname>PDOStatement::fetchAll</methodname></member>
110
+
<member><methodname>PDO::prepare</methodname></member>
111
+
<member><methodname>PDOStatement::setFetchMode</methodname></member>
107
112
</simplelist>
108
113
</para>
109
114
</refsect1>
110
115
</refentry>
111
-

112
116
<!-- Keep this comment at the end of the file
113
117
Local variables:
114
118
mode: sgml
115
119