Close bug #69775 (fetchColumn() example is misleading)

Patch by cmb

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@336896 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Maciej Sobaczewski 2015-06-09 07:07:33 +00:00
parent 37f3578383
commit 7eb76b1f1f

View file

@ -72,12 +72,11 @@
$sth = $dbh->prepare("SELECT name, colour FROM fruit");
$sth->execute();
/* Fetch the first column from the next row in the result set */
print("Fetch the first column from the next row in the result set:\n");
print("Fetch the first column from the first row in the result set:\n");
$result = $sth->fetchColumn();
print("name = $result\n");
print("Fetch the second column from the next row in the result set:\n");
print("Fetch the second column from the second row in the result set:\n");
$result = $sth->fetchColumn(1);
print("colour = $result\n");
?>
@ -86,9 +85,9 @@ print("colour = $result\n");
&example.outputs;
<screen>
<![CDATA[
Fetch the first column from the next row in the result set:
Fetch the first column from the first row in the result set:
name = lemon
Fetch the second column from the next row in the result set:
Fetch the second column from the second row in the result set:
colour = red
]]>
</screen>