title: PDO driver specific error code
body: <p>I used <a href="http://php.net/manual/en/pdo.errorinfo.php" rel="nofollow"><code>PDO::errorInfo</code></a> to fetch extended error information. This does return an array which includes <strong>Driver-specific error code</strong>.</p>
  
  <p>On my mind, I am planning to get the specific returned driver error code (<code>[1]</code> <strong><em>in array return</em></strong>)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?</p>
  
  <p><em>MySQL version 5.5.21, InnoDB engine.</em></p>
  
  <p>Sample of <code>errorInfo()</code> returns:</p>
  
  <pre><code>Array
  (
    [0] =&gt; 23000
    [1] =&gt; 1452
    [2] =&gt; Cannot add or update a child row; a foreign key constraint fails...
  )
  Array
  (
    [0] =&gt; 23000
    [1] =&gt; 1062
    [2] =&gt; Duplicate entry 'Ovjsuy2' for key 'column_name'
  )
  </code></pre>