nlopess Wed Feb 14 19:42:28 2007 UTC
Modified files: /phpdoc/en/reference/pdo/functions PDO-errorInfo.xml Log: fix example (noticed by a user note) http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/pdo/functions/PDO-errorInfo.xml?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/en/reference/pdo/functions/PDO-errorInfo.xml diff -u phpdoc/en/reference/pdo/functions/PDO-errorInfo.xml:1.9 phpdoc/en/reference/pdo/functions/PDO-errorInfo.xml:1.10 --- phpdoc/en/reference/pdo/functions/PDO-errorInfo.xml:1.9 Sun Jan 7 20:57:47 2007 +++ phpdoc/en/reference/pdo/functions/PDO-errorInfo.xml Wed Feb 14 19:42:28 2007 @@ -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 @@ 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>