fix example (noticed by a user note)

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@229814 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2007-02-14 19:42:28 +00:00
parent d6270d0c3b
commit b6e207d730

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.PDO-errorInfo">
<refnamediv>
<refname>PDO->errorInfo()</refname>
@ -71,11 +71,12 @@
<programlisting role="php">
<![CDATA[
<?php
/* Provoke an error -- the BONES table does not exist */
$err = $dbh->prepare('SELECT skull FROM bones');
$err->execute();
echo "\nPDO::errorInfo():\n";
print_r($err->errorInfo());
/* Provoke an error -- bogus SQL syntax */
$stmt = $dbh->prepare('bogus sql');
if (!$stmt) {
echo "\nPDO::errorInfo():\n";
print_r($dbh->errorInfo());
}
?>
]]>
</programlisting>
@ -85,9 +86,9 @@ print_r($err->errorInfo());
PDO::errorInfo():
Array
(
[0] => 42S02
[1] => -204
[2] => [IBM][CLI Driver][DB2/LINUX] SQL0204N "DANIELS.BONES" is an undefined name. SQLSTATE=42704
[0] => HY000
[1] => 1
[2] => near "bogus": syntax error
)
]]>
</screen>