PDOSTATEMENT.ERRORCODE(3) 1 PDOSTATEMENT.ERRORCODE(3) PDOStatement::errorCode - Fetch the SQLSTATE associated with the last operation on the statement handleSYNOPSISpublic string PDOStatement::errorCode (void )DESCRIPTIONRETURN VALUESIdentical to PDO.errorCode(3), except that PDOStatement.errorCode(3) only retrieves error codes for operations performed with PDOStatement objects.EXAMPLESExample #1 Retrieving an SQLSTATE code <?php /* Provoke an error -- the BONES table does not exist */ $err = $dbh->prepare('SELECT skull FROM bones'); $err->execute(); echo " PDOStatement::errorCode(): "; print $err->errorCode(); ?> The above example will output: PDOStatement::errorCode(): 42S02SEE ALSOPDO.errorCode(3), PDO.errorInfo(3), PDOStatement.errorInfo(3). PHP Documentation Group PDOSTATEMENT.ERRORCODE(3)