1--TEST--
2SQLite3::lastInsertRowID 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->lastInsertRowID());
17var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));
18var_dump($db->lastInsertRowID());
19
20echo "Closing database\n";
21var_dump($db->close());
22echo "Done\n";
23?>
24--EXPECTF--
25Creating Table
26bool(true)
27INSERT into table
28bool(true)
29int(1)
30bool(true)
31int(2)
32Closing database
33bool(true)
34Done
35