mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
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:
parent
37f3578383
commit
7eb76b1f1f
1 changed files with 4 additions and 5 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue