xref: /php-src/ext/pdo_sqlite/tests/bug33841.phpt (revision 417f3fdb)
1--TEST--
2PDO SQLite Bug #33841 (rowCount() does not work on prepared statements)
3--EXTENSIONS--
4pdo_sqlite
5--FILE--
6<?php
7require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
8$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
9
10$db->exec('CREATE TABLE test_33841 (text)');
11
12$stmt = $db->prepare("INSERT INTO test_33841 VALUES ( :text )");
13$stmt->bindParam(':text', $name);
14$name = 'test1';
15var_dump($stmt->execute(), $stmt->rowCount());
16
17$stmt = $db->prepare("UPDATE test_33841 SET text = :text ");
18$stmt->bindParam(':text', $name);
19$name = 'test2';
20var_dump($stmt->execute(), $stmt->rowCount());
21?>
22--CLEAN--
23<?php
24require __DIR__ . '/../../../ext/pdo/tests/pdo_test.inc';
25$db = PDOTest::test_factory(__DIR__ . '/common.phpt');
26$db->exec('DROP TABLE IF EXISTS test_33841');
27?>
28--EXPECT--
29bool(true)
30int(1)
31bool(true)
32int(1)
33