Error handling
Error handling is implemented using a hand-shaking protocol between
PDO and the database driver code. The database driver code
signals PDO that an error has occurred via a failure
(0) return from any of the interface functions. If a zero
is returned, set the field
The error_mode field is a six-byte field containing a 5 character ASCIIZ
SQLSTATE identifier code. This code drives the error message process. The
SQLSTATE code is used to look up an error message in the internal PDO error
message table (see pdo_sqlstate.c for a list of error codes and their
messages). If the code is not known to PDO, a default
In addition to the SQLSTATE code and error message, PDO will call the driver-specific fetch_err() routine to obtain supplemental data for the particular error condition. This routine is passed an array into which the driver may place additional information. This array has slot positions assigned to particular types of supplemental info:
|