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

31 lines
750 B
Plaintext
Raw Normal View History

2017-05-03 23:04:17 +02:00
--TEST--
Test bindValue 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";
$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();
dropTable($db, $tbname);
unset($stmt);
unset($db);
2017-05-03 23:04:17 +02:00
echo "Test Complete!\n";
} catch (PDOException $e) {
2017-05-03 23:04:17 +02:00
var_dump($e);
}
?>
--EXPECT--
Test Complete!