php-sqlsrv/test/functional/pdo_sqlsrv/pdostatement_debugDumpParams.phpt

44 lines
1,000 B
Plaintext
Raw Normal View History

2017-05-03 23:04:17 +02:00
--TEST--
Test debugDumpParams method.
--SKIPIF--
<?php require("skipif_mid-refactor.inc"); ?>
2017-05-03 23:04:17 +02:00
--FILE--
<?php
require_once('MsCommon_mid-refactor.inc');
require_once("MsData_PDO_AllTypes.inc");
2017-05-03 23:04:17 +02:00
try {
2017-05-03 23:04:17 +02:00
$db = connect();
$tbname = "PDO_AllTypes";
createAndInsertTableAllTypes($db, $tbname);
2017-05-03 23:04:17 +02:00
$bigint = 1;
$string = "STRINGCOL1";
2017-11-04 01:01:09 +01:00
$stmt = $db->prepare("SELECT IntCol FROM $tbname WHERE BigIntCol = :bigint AND CharCol = :string");
2017-05-03 23:04:17 +02:00
$stmt->bindValue(':bigint', $bigint, PDO::PARAM_INT);
$stmt->bindValue(':string', $string, PDO::PARAM_STR);
$stmt->execute();
2017-05-03 23:04:17 +02:00
$stmt->debugDumpParams();
dropTable($db, $tbname);
unset($stmt);
unset($db);
} catch (PDOException $e) {
2017-05-03 23:04:17 +02:00
var_dump($e);
}
?>
2021-07-29 00:45:04 +02:00
--EXPECTF--
2017-05-03 23:04:17 +02:00
SQL: [79] SELECT IntCol FROM PDO_AllTypes WHERE BigIntCol = :bigint AND CharCol = :string
Params: 2
Key: Name: [7] :bigint
paramno=0
name=[7] ":bigint"
is_param=1
2021-07-29 00:45:04 +02:00
param_type=%d
2017-05-03 23:04:17 +02:00
Key: Name: [7] :string
paramno=1
name=[7] ":string"
is_param=1
2021-07-29 00:45:04 +02:00
param_type=%d