You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
620 B

23 years ago
23 years ago
  1. --TEST--
  2. sqlite-oo: fetch all (buffered)
  3. --INI--
  4. sqlite.assoc_case=0
  5. --SKIPIF--
  6. <?php # vim:ft=php
  7. if (!extension_loaded("sqlite")) print "skip"; ?>
  8. --FILE--
  9. <?php
  10. include "blankdb_oo.inc";
  11. $data = array(
  12. "one",
  13. "two",
  14. "three"
  15. );
  16. $db->query("CREATE TABLE strings(a VARCHAR)");
  17. foreach ($data as $str) {
  18. $db->query("INSERT INTO strings VALUES('$str')");
  19. }
  20. $r = $db->query("SELECT a from strings");
  21. while ($row = $r->fetch(SQLITE_NUM)) {
  22. var_dump($row);
  23. }
  24. echo "DONE!\n";
  25. ?>
  26. --EXPECT--
  27. array(1) {
  28. [0]=>
  29. string(3) "one"
  30. }
  31. array(1) {
  32. [0]=>
  33. string(3) "two"
  34. }
  35. array(1) {
  36. [0]=>
  37. string(5) "three"
  38. }
  39. DONE!