title: How to debug correctly an Insert statement with PDO (mysql)?
body: <pre><code>$PDO_db = new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME.';charset=UTF-8' , DB_USER, DB_PWD);
  $sth = $PDO_db-&gt;prepare($insert);   
  $arrPar = array(':nome' =&gt;  $nome);         
  $r = $sth-&gt;execute($arrPar);    
  var_dump($arrPar);
  print_r($PDO_db-&gt;errorInfo());
  var_dump($r);
  exit();
  </code></pre>
  
  <p>Supppose that the $insert statemet contains a SQL error, with the code above I've noticed the following :</p>
  
  <ol>
  <li><p>Code A</p>
  
  <pre><code>print_r($PDO_db-&gt;errorInfo());
  </code></pre>
  
  <p>will output anyways:</p>
  
  <pre><code>Array (
      [0] =&gt; 00000
      [1] =&gt; 
      [2] =&gt; 
  )
  </code></pre>
  
  <p>but var_dump($s) is false</p></li>
  <li><p>If in the insert statement I have some <code>placemark</code> e.g. <code>:name</code> </p>
  
  <pre><code>"Insert into mytable (name) VALUE(:name);"
  </code></pre>
  
  <p>And then in the <code>$arrPar = array(':name' =&gt; $value)</code> with <code>$value=NULL</code></p>
  
  <pre><code>print_r($PDO_db-&gt;errorInfo());
  </code></pre>
  
  <p>will output again:</p>
  
  <pre><code>Array
  (
      [0] =&gt; 00000
      [1] =&gt; 
      [2] =&gt; 
  )
  </code></pre>
  
  <p>but var_dump($s) is false</p></li>
  </ol>
  
  <p>So I'm wondering to know what's the correct way to debug MySQL statements with PDO if the method <strong>errorInfo</strong>, which is supposed to give me a error description, silently quiets errors?</p>
  
  <p><code>PDO::errorInfo()</code> returns an array of error information"</p>