开发者

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
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜