diff options
author | Popa Adrian Marius <mariuz@php.net> | 2011-12-28 09:41:02 +0000 |
---|---|---|
committer | Popa Adrian Marius <mariuz@php.net> | 2011-12-28 09:41:02 +0000 |
commit | cc57d73844f6a749ed105396c5dbe73c5c97e0f1 (patch) | |
tree | 97ca93e68c91f1f86822bf9a8f5df3ae1b8a9084 | |
parent | 467ed9255b019742a55fd7394646964176018ff0 (diff) | |
download | php-git-cc57d73844f6a749ed105396c5dbe73c5c97e0f1.tar.gz |
cleanup for bug 48877 test, add description
-rw-r--r-- | ext/pdo_firebird/tests/bug_48877.phpt | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ext/pdo_firebird/tests/bug_48877.phpt b/ext/pdo_firebird/tests/bug_48877.phpt new file mode 100644 index 0000000000..290cd7a3a0 --- /dev/null +++ b/ext/pdo_firebird/tests/bug_48877.phpt @@ -0,0 +1,42 @@ +--TEST-- +PDO_Firebird: bug 48877 The "bindValue" and "bindParam" do not work for PDO Firebird if we use named parameters (:parameter). +--SKIPIF-- +<?php extension_loaded("pdo_firebird") or die("skip"); ?> +--FILE-- +<?php + +require("testdb.inc"); + +$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die; +$value = '2'; +@$dbh->exec('DROP TABLE testz'); +$dbh->exec('CREATE TABLE testz (A integer)'); +$dbh->exec("INSERT INTO testz VALUES ('1')"); +$dbh->exec("INSERT INTO testz VALUES ('2')"); +$dbh->exec("INSERT INTO testz VALUES ('3')"); +$dbh->commit(); + +$query = "SELECT * FROM testz WHERE A = :paramno"; + +$stmt = $dbh->prepare($query); +$stmt->bindParam(':paramno', $value, PDO::PARAM_STR); +$stmt->execute(); +$rows = $stmt->fetch(); +var_dump($stmt->fetch()); +var_dump($stmt->rowCount()); + + +$stmt = $dbh->prepare('DELETE FROM testz'); +$stmt->execute(); + +$dbh->commit(); + +$dbh->exec('DROP TABLE testz'); + +unset($stmt); +unset($dbh); + +?> +--EXPECT-- +bool(false) +int(1) |