xref: /PHP-7.2/ext/pdo_sqlite/tests/bug33841.phpt (revision f1d7e3ca)
1--TEST--
2PDO SQLite Bug #33841 (rowCount() does not work on prepared statements)
3--SKIPIF--
4<?php # vim:ft=php
5if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
6?>
7--FILE--
8<?php
9require dirname(__FILE__) . '/../../../ext/pdo/tests/pdo_test.inc';
10$db = PDOTest::test_factory(dirname(__FILE__) . '/common.phpt');
11
12$db->exec('CREATE TABLE test (text)');
13
14$stmt = $db->prepare("INSERT INTO test VALUES ( :text )");
15$stmt->bindParam(':text', $name);
16$name = 'test1';
17var_dump($stmt->execute(), $stmt->rowCount());
18
19$stmt = $db->prepare("UPDATE test SET text = :text ");
20$stmt->bindParam(':text', $name);
21$name = 'test2';
22var_dump($stmt->execute(), $stmt->rowCount());
23--EXPECT--
24bool(true)
25int(1)
26bool(true)
27int(1)
28