mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00

* 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>
20 lines
501 B
PHP
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)
|