bug_48877.phpt 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. <?php function_exists("ibase_query") or die("skip"); ?>
  6. --FILE--
  7. <?php
  8. require("testdb.inc");
  9. $dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
  10. $value = '2';
  11. @$dbh->exec('DROP TABLE testz');
  12. $dbh->exec('CREATE TABLE testz (A integer)');
  13. $dbh->exec("INSERT INTO testz VALUES ('1')");
  14. $dbh->exec("INSERT INTO testz VALUES ('2')");
  15. $dbh->exec("INSERT INTO testz VALUES ('3')");
  16. $dbh->commit();
  17. $query = "SELECT * FROM testz WHERE A = :paramno";
  18. $stmt = $dbh->prepare($query);
  19. $stmt->bindParam(':paramno', $value, PDO::PARAM_STR);
  20. $stmt->execute();
  21. $rows = $stmt->fetch();
  22. var_dump($stmt->fetch());
  23. var_dump($stmt->rowCount());
  24. $stmt = $dbh->prepare('DELETE FROM testz');
  25. $stmt->execute();
  26. $dbh->commit();
  27. $dbh->exec('DROP TABLE testz');
  28. unset($stmt);
  29. unset($dbh);
  30. ?>
  31. --EXPECT--
  32. bool(false)
  33. int(1)