1--TEST--
2PDO_Firebird: rowCount
3--SKIPIF--
4<?php extension_loaded("pdo_firebird") or die("skip"); ?>
5<?php function_exists("ibase_query") or die("skip"); ?>
6--FILE--
7<?php /* $Id$ */
8
9require("testdb.inc");
10
11$dbh = new PDO("firebird:dbname=$test_base",$user,$password) or die;
12
13@$dbh->exec('DROP TABLE testz');
14$dbh->exec('CREATE TABLE testz (A VARCHAR(10))');
15$dbh->exec("INSERT INTO testz VALUES ('A')");
16$dbh->exec("INSERT INTO testz VALUES ('A')");
17$dbh->exec("INSERT INTO testz VALUES ('B')");
18$dbh->commit();
19
20$query = "SELECT * FROM testz WHERE A = ?";
21
22$stmt = $dbh->prepare($query);
23$stmt->execute(array('A'));
24$rows = $stmt->fetch();
25$rows = $stmt->fetch();
26var_dump($stmt->fetch());
27var_dump($stmt->rowCount());
28
29$stmt = $dbh->prepare('UPDATE testZ SET A="A" WHERE A != ?');
30$stmt->execute(array('A'));
31var_dump($stmt->rowCount());
32$dbh->commit();
33
34$stmt = $dbh->prepare('DELETE FROM testz');
35$stmt->execute();
36var_dump($stmt->rowCount());
37
38$dbh->commit();
39
40$dbh->exec('DROP TABLE testz');
41
42unset($stmt);
43unset($dbh);
44
45?>
46--EXPECT--
47bool(false)
48int(2)
49int(1)
50int(3)
51