xref: /PHP-8.2/ext/pdo_sqlite/tests/bug33841.phpt (revision 74859783)
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 (text)');
11
12$stmt = $db->prepare("INSERT INTO test VALUES ( :text )");
13$stmt->bindParam(':text', $name);
14$name = 'test1';
15var_dump($stmt->execute(), $stmt->rowCount());
16
17$stmt = $db->prepare("UPDATE test SET text = :text ");
18$stmt->bindParam(':text', $name);
19$name = 'test2';
20var_dump($stmt->execute(), $stmt->rowCount());
21?>
22--EXPECT--
23bool(true)
24int(1)
25bool(true)
26int(1)
27