Echo PDO query for debugging purposes
For debugging purposes, how d开发者_JAVA百科o I echo the query generated by PDO so I can see what it is about the execute?
Use: $PDOStatement->queryString
Example code:
$usedParams = array(
':id' => 1
);
echo str_replace(
array_keys($usedParams), $usedParams, $stmt->queryString
);
精彩评论