xref: /PHP-5.6/ext/pdo_sqlite/tests/bug33841.phpt (revision 8b91c8f3)
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
24--EXPECT--
25bool(true)
26int(1)
27bool(true)
28int(1)
29