diff --git a/reference/pdo/functions/PDO-errorInfo.xml b/reference/pdo/functions/PDO-errorInfo.xml index 7324c61973..afbb0f025f 100644 --- a/reference/pdo/functions/PDO-errorInfo.xml +++ b/reference/pdo/functions/PDO-errorInfo.xml @@ -1,5 +1,5 @@ - + PDO->errorInfo() @@ -71,11 +71,12 @@ 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()); +} ?> ]]> @@ -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 ) ]]>