I used PDO::errorInfo
to fetch extended error information. This does return an array which includes Driver-specific error code.
On my mind, I am planning to get the specific returned driver error code ([1]
in array return)then associate it with my own custom error description. What matters me is that I can't seem to have a list of all the driver specific error codes on this. Any ideas?
MySQL version 5.5.21, InnoDB engine.
Sample of errorInfo()
returns:
Array
(
[0] => 23000
[1] => 1452
[2] => Cannot add or update a child row; a foreign key constraint fails...
)
Array
(
[0] => 23000
[1] => 1062
[2] => Duplicate entry 'Ovjsuy2' for key 'column_name'
)