PDOStatement::debugDumpParams

Displays a prepared statement.


bool PDOStatement::debugDumpParams();

Support for PDO was added in version 2.0 of the Microsoft Drivers for PHP for SQL Server.

<?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();
?>

Reference

Other Resources

PDO

Community Additions

Show: