title: Getting a PDO query string with bound parameters without executing it
body: <p>Is it possible to get a query string from a PDO object with bound parameters without executing it first? I have code similar to the following (where $dbc is the PDO object):</p>
  
  <pre><code>$query = 'SELECT * FROM users WHERE username = ?';
  $result = $dbc-&gt;prepare($query);
  $username = 'bob';
  $result-&gt;bindParam(1, $username);
  echo $result-&gt;queryString;
  </code></pre>
  
  <p>Currently, this will echo out a SQL statement like: "SELECT * FROM users WHERE username = ?". However, I would like to have the bound parameter included so that it looks like: 'SELECT * FROM users WHERE username = 'bob'". Is there a way to do that without executing it or replacing the question marks with the parameters through something like preg_replace?</p>