reference/pdo/pdostatement/rowcount.xml
a5950d8ae47e8befb9fa5f774ddb96a860833ed5
...
...
@@ -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,16 +20,16 @@
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>
29
30
<note>
30
31
<para>
31
-
This method returns "0" (zero) with the SQLite driver at all times,
32
-
and with the PostgreSQL driver only when setting the
32
+
This method returns "0" (zero) with PostgreSQL driver when setting the
33
33
<constant>PDO::ATTR_CURSOR</constant> statement attribute to
34
34
<constant>PDO::CURSOR_SCROLL</constant>.
35
35
</para>
...
...
@@ -48,6 +48,11 @@
48
48
</para>
49
49
</refsect1>
50
50

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

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

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

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