1--TEST--
2SQLite3Stmt::paramCount error test
3--SKIPIF--
4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5--FILE--
6<?php
7
8require_once(dirname(__FILE__) . '/new_db.inc');
9
10echo "Creating Table\n";
11var_dump($db->exec('CREATE TABLE foobar (id INTEGER, name STRING, city STRING)'));
12
13echo "INSERT into table\n";
14var_dump($db->exec("INSERT INTO foobar (id, name, city) VALUES (1, 'john', 'LA')"));
15var_dump($db->exec("INSERT INTO foobar (id, name, city) VALUES (2, 'doe', 'SF')"));
16
17
18$query = "SELECT * FROM foobar WHERE id = ? ORDER BY id ASC";
19
20echo "SELECTING results\n";
21
22$stmt = $db->prepare($query);
23
24echo "paramCount with wrong number of arguments\n";
25var_dump($stmt->paramCount('foobar'));
26$result = $stmt->execute();
27echo "Closing database\n";
28$stmt = null;
29$result = null;
30var_dump($db->close());
31echo "Done\n";
32?>
33--EXPECTF--
34Creating Table
35bool(true)
36INSERT into table
37bool(true)
38bool(true)
39SELECTING results
40paramCount with wrong number of arguments
41
42Warning: SQLite3Stmt::paramCount() expects exactly 0 parameters, 1 given in %s on line %d
43NULL
44Closing database
45bool(true)
46Done
47