1--TEST--
2SQLite3 error functions
3--EXTENSIONS--
4sqlite3
5--FILE--
6<?php
7
8require_once(__DIR__ . '/new_db.inc');
9
10echo "SELECTING from invalid table\n";
11$result = $db->query("SELECT * FROM non_existent_table");
12if (!$result) {
13    echo "Error Code: " . $db->lastErrorCode() . "\n";
14    echo "Error Msg: " . $db->lastErrorMsg() . "\n";
15}
16echo "Closing database\n";
17var_dump($db->close());
18echo "Done\n";
19?>
20--EXPECTF--
21SELECTING from invalid table
22
23Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %s on line %d
24Error Code: 1
25Error Msg: no such table: non_existent_table
26Closing database
27bool(true)
28Done
29