<?php/* Provoke an error -- the BONES table does not exist */$dbh->exec("INSERT INTO bones(skull) VALUES ('lucy')"); echo "\nPDO::errorCode(): "; print $dbh->errorCode();?>
The above example will output:
PDO::errorCode(): 42S02