php-src/ext/sqlite3/tests/sqlite3_prepare_faultystmt.phpt
BohwaZ ddd9a08f56
[RFC] Transition SQLite3 to exceptions (#11058)
* Deprecate warnings in SQLite3, change returned exception class to SQLite3Exception

RFC: https://wiki.php.net/rfc/sqlite3_exceptions

Co-authored-by: Tim Düsterhus <timwolla@googlemail.com>
2023-07-03 14:30:52 +01:00

20 lines
501 B
PHP

--TEST--
SQLite3::prepare test, testing for faulty statement
--CREDITS--
Michelangelo van Dam
# Belgian PHP Testfest 2009
--EXTENSIONS--
sqlite3
--FILE--
<?php
$db = new SQLite3(':memory:');
$db->exec('CREATE TABLE foo (id INTEGER, bar STRING)');
$db->exec("INSERT INTO foo (id, bar) VALUES (1, 'This is a test')");
$stmt = $db->prepare('SELECT foo FROM bar');
var_dump($stmt);
?>
--EXPECTF--
Warning: SQLite3::prepare(): Unable to prepare statement: no such table: bar in %s on line %d
bool(false)