By default, PDO uses the silent error handling mode. This means that any error that arises when calling methods of the PDO
or PDOStatement
classes go unreported. With this mode, one would have to call PDO::errorInfo(), PDO::errorCode(), PDOStatement::errorInfo()
, or PDOStatement::errorCode()
, every time an error occurred to see if it really did occur. Note that this mode is similar to traditional database access—usually, the code calls mysql_errno()
and mysql_error()
(or equivalent functions for other database systems) after calling functions that could cause an error, after connecting to a database and after issuing a query.
Another mode is the warning mode. Here, PDO
will act identical to the traditional database access. Any error that happens during communication with the database would raise an E_WARNING
error. Depending on the configuration, an error message could be displayed or logged into a file.
Finally, PDO introduces a modern way of handling database...