sqlite3stmt_reset_params.phpt 940 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. SQLite3Stmt::reset with parameter test
  3. --CREDITS--
  4. Jelle Lampaert
  5. #Belgian Testfest 2009
  6. --SKIPIF--
  7. <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
  8. --FILE--
  9. <?php
  10. $db = new SQLite3(':memory:');
  11. echo "Creating Table\n";
  12. var_dump($db->exec('CREATE TABLE foobar (id INTEGER, name STRING)'));
  13. echo "INSERT into table\n";
  14. var_dump($db->exec("INSERT INTO foobar (id, name) VALUES (1, 'john')"));
  15. $query = "SELECT name FROM foobar WHERE id = 1";
  16. echo "Prepare query\n";
  17. $stmt = $db->prepare($query);
  18. echo "Reset query\n";
  19. try {
  20. $stmt->reset("foo");
  21. } catch (Exception $ex) {
  22. var_dump($ex->getMessage());
  23. }
  24. echo "Closing database\n";
  25. $stmt = null;
  26. $result = null;
  27. var_dump($db->close());
  28. echo "Done\n";
  29. ?>
  30. --EXPECTF--
  31. Creating Table
  32. bool(true)
  33. INSERT into table
  34. bool(true)
  35. Prepare query
  36. Reset query
  37. Warning: SQLite3Stmt::reset() expects exactly 0 parameters, %d given in %s on line %d
  38. Closing database
  39. bool(true)
  40. Done