sqlite3_prepare_faultystmt.phpt 504 B

1234567891011121314151617181920
  1. --TEST--
  2. SQLite3::prepare test, testing for faulty statement
  3. --CREDITS--
  4. Michelangelo van Dam
  5. # Belgian PHP Testfest 2009
  6. --EXTENSIONS--
  7. sqlite3
  8. --FILE--
  9. <?php
  10. $db = new SQLite3(':memory:');
  11. $db->exec('CREATE TABLE foo (id INTEGER, bar STRING)');
  12. $db->exec("INSERT INTO foo (id, bar) VALUES (1, 'This is a test')");
  13. $stmt = $db->prepare('SELECT foo FROM bar');
  14. var_dump($stmt);
  15. ?>
  16. --EXPECTF--
  17. Warning: SQLite3::prepare(): Unable to prepare statement: 1, no such table: bar in %s on line %d
  18. bool(false)