php-sqlsrv/test/bvt/pdo_sqlsrv/msdn_pdoStatement_debugDumpParams.phpt

42 lines
896 B
Plaintext
Raw Normal View History

2017-06-03 00:59:44 +02:00
--TEST--
displays a prepared statement
--SKIPIF--
<?php require('skipif.inc'); ?>
2017-06-03 00:59:44 +02:00
--FILE--
<?php
require('connect.inc');
$conn = new PDO( "sqlsrv:server=$server ; Database = $databaseName", "$uid", "$pwd");
$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();
//free the statement and connection
$stmt=null;
$conn=null;
?>
2021-07-29 00:45:04 +02:00
--EXPECTREGEX--
SQL: \[52\] select \* from Person.ContactType where name = \:param
2017-06-03 00:59:44 +02:00
Params: 1
2021-07-29 00:45:04 +02:00
Key: Name: \[6\] :param
2017-06-03 00:59:44 +02:00
paramno=0
2021-07-29 00:45:04 +02:00
name=\[6\] ":param"
2017-06-03 00:59:44 +02:00
is_param=1
2021-07-29 00:45:04 +02:00
param_type=(2|3)
2017-06-03 00:59:44 +02:00
2021-07-29 00:45:04 +02:00
SQL: \[47\] select \* from Person.ContactType where name = \?
2017-06-03 00:59:44 +02:00
Params: 1
Key: Position #0:
paramno=0
2021-07-29 00:45:04 +02:00
name=\[0\] ""
2017-06-03 00:59:44 +02:00
is_param=1
2021-07-29 00:45:04 +02:00
param_type=(2|3)