1--TEST--
2SQLite3::querySingle tests
3--SKIPIF--
4<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5--FILE--
6<?php
7
8require_once(dirname(__FILE__) . '/new_db.inc');
9define('TIMENOW', time());
10
11echo "Creating Table\n";
12var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)'));
13
14echo "INSERT into table\n";
15var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')"));
16var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));
17
18echo "SELECTING results\n";
19var_dump($db->querySingle("SELECT id FROM test WHERE id = 'a'"));
20var_dump($db->querySingle("SELECT id, time FROM test WHERE id = 'a'", true));
21
22echo "Done"
23?>
24--EXPECTF--
25Creating Table
26bool(true)
27INSERT into table
28bool(true)
29bool(true)
30SELECTING results
31string(1) "a"
32array(2) {
33  ["id"]=>
34  string(1) "a"
35  ["time"]=>
36  int(%d)
37}
38Done
39