Returns a SQLSTATE, a five-character alphanumeric identifier defined in the ANSI SQL
standard. PDOStatement::errorCode() only retrieves error codes
for operations performed with PDOStatement objects.
例
例子 1. Retrieving a SQLSTATE code
<?php /* Provoke an error -- the BONES table does not exist */ $err = $dbh->prepare('SELECT skull FROM bones'); $err->execute();