reference/pdo/pdostatement/rowcount.xml
28529d3539b850e870e3aa97570f4db0e53daa03
...
...
@@ -9,7 +9,7 @@
9
9
</refnamediv>
10
10
<refsect1 role="description">
11
11
&reftitle.description;
12
-
<methodsynopsis>
12
+
<methodsynopsis role="PDOStatement">
13
13
<modifier>public</modifier> <type>int</type><methodname>PDOStatement::rowCount</methodname>
14
14
<void/>
15
15
</methodsynopsis>
...
...
@@ -20,9 +20,10 @@
20
20
executed by the corresponding <literal>PDOStatement</literal> object.
21
21
</para>
22
22
<para>
23
-
If the last SQL statement executed by the associated
24
-
<literal>PDOStatement</literal> was a SELECT statement, some databases
25
-
may return the number of rows returned by that statement. However, this
23
+
For statements that produce result sets, such as <literal>SELECT</literal>,
24
+
the behavior is undefined and can be different for each driver.
25
+
Some databases may return the number of rows produced by that statement
26
+
(e.g. MySQL in buffered mode), but this
26
27
behaviour is not guaranteed for all databases and should not be relied
27
28
on for portable applications.
28
29
</para>
...
...
@@ -48,6 +49,11 @@
48
49
</para>
49
50
</refsect1>
50
51

52
+
<refsect1 role="errors">
53
+
&reftitle.errors;
54
+
&pdo.errors;
55
+
</refsect1>
56
+
51
57
<refsect1 role="examples">
52
58
&reftitle.examples;
53
59
<para>
...
...
@@ -65,9 +71,9 @@ $del = $dbh->prepare('DELETE FROM fruit');
65
71
$del->execute();
66
72

67
73
/* Return number of rows that were deleted */
68
-
print("Return number of rows that were deleted:\n");
74
+
print "Return number of rows that were deleted:\n";
69
75
$count = $del->rowCount();
70
-
print("Deleted $count rows.\n");
76
+
print "Deleted $count rows.\n";
71
77
?>
72
78
]]>
73
79
</programlisting>
...
...
@@ -121,7 +127,6 @@ There are 2 matching records.
121
127

122
128
</refsect1>
123
129
</refentry>
124
-

125
130
<!-- Keep this comment at the end of the file
126
131
Local variables:
127
132
mode: sgml
128
133