PDOStatement::debugDumpParams
显示已准备的语句。
语法
bool PDOStatement::debugDumpParams();
备注
已在 Microsoft Drivers for PHP for SQL Server的版本 2.0 中添加了对 PDO 的支持。
示例
<?php
$database = "AdventureWorks";
$server = "(local)";
$conn = new PDO( "sqlsrv:server=$server ; Database = $database", "", "");
$param = "Owner";
$stmt = $conn->prepare("select * from Person.ContactType where name = :param");
$stmt->execute(array($param));
$stmt->debugDumpParams();
echo "\n\n";
$stmt = $conn->prepare("select * from Person.ContactType where name = ?");
$stmt->execute(array($param));
$stmt->debugDumpParams();
?>