title: Get Last Executed Query in PHP PDO
body: <p>I would like to know what query is executed using PHP PDO. I have:</p>
  
  <pre><code>&lt;?php
  
  try {  
    $DBH = new PDO("mysql:host=localhost;dbname=mytable", 'myuser', 'mypass');  
  }  
  catch(PDOException $e) {  
      echo $e-&gt;getMessage();  
  }  
  
  $DBH-&gt;setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );  
  $DBH-&gt;setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );  
  
  $STH = $DBH-&gt;("INSERT INTO mytable (column1, column2, column3 /* etc...*/) value (:column1, :column2, :column3 /* etc...*/)"); 
  $STH-&gt;bindParam(':column1', $column1);  
  $STH-&gt;bindParam(':column2', $column2);  
  $STH-&gt;bindParam(':column3', $column3);  
   /* etc...*/
  
  $STH-&gt;execute();  
  
  // what is my query?
  </code></pre>
  
  <p>I would like to get something like:</p>
  
  <pre><code>INSERT INTO mytable (column1, column2, column3) value ('my first column', 32, 'some text')
  </code></pre>
  
  <p>Is it possible? Thanks</p>