Annotation of embedaddon/php/ext/pdo_firebird/tests/bug_48877.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: PDO_Firebird: bug 48877 The "bindValue" and "bindParam" do not work for PDO Firebird if we use named parameters (:parameter).
! 3: --SKIPIF--
! 4: <?php extension_loaded("pdo_firebird") or die("skip"); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: require("testdb.inc");
! 9:
! 10: $dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
! 11: $value = '2';
! 12: @$dbh->exec('DROP TABLE testz');
! 13: $dbh->exec('CREATE TABLE testz (A integer)');
! 14: $dbh->exec("INSERT INTO testz VALUES ('1')");
! 15: $dbh->exec("INSERT INTO testz VALUES ('2')");
! 16: $dbh->exec("INSERT INTO testz VALUES ('3')");
! 17: $dbh->commit();
! 18:
! 19: $query = "SELECT * FROM testz WHERE A = :paramno";
! 20:
! 21: $stmt = $dbh->prepare($query);
! 22: $stmt->bindParam(':paramno', $value, PDO::PARAM_STR);
! 23: $stmt->execute();
! 24: $rows = $stmt->fetch();
! 25: var_dump($stmt->fetch());
! 26: var_dump($stmt->rowCount());
! 27:
! 28:
! 29: $stmt = $dbh->prepare('DELETE FROM testz');
! 30: $stmt->execute();
! 31:
! 32: $dbh->commit();
! 33:
! 34: $dbh->exec('DROP TABLE testz');
! 35:
! 36: unset($stmt);
! 37: unset($dbh);
! 38:
! 39: ?>
! 40: --EXPECT--
! 41: bool(false)
! 42: int(1)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>