本文介绍了使用PHP PDO显示bindParam的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有一种简单的方法可以回显绑定参数中存储的值.
Is there an easy way to echo the value stored in a bound parameter.
$sql ="call storedproc(:firstname, :lastname)";
$stmt = $this->DBH->prepare($sql);
$stmt->bindParam(':firstname', $fname);
$stmt->bindParam(':lastname', $lname);
//I want to do this
echo $stmt->firstname;
$stmt->execute;
推荐答案
如果您只想看看"发生了什么,则可以使用 PDOStatement-> debugDumpParams():
If you only want to "see" what's going on then there's PDOStatement->debugDumpParams():
这篇关于使用PHP PDO显示bindParam的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!