Annotation of embedaddon/php/ext/sqlite/tests/sqlite_oo_010.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: sqlite-oo: fetch all (iterator)
! 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:
! 12: $data = array(
! 13: "one",
! 14: "two",
! 15: "three"
! 16: );
! 17:
! 18: $db->query("CREATE TABLE strings(a VARCHAR)");
! 19:
! 20: foreach ($data as $str) {
! 21: $db->query("INSERT INTO strings VALUES('$str')");
! 22: }
! 23:
! 24: $r = $db->unbufferedQuery("SELECT a from strings", SQLITE_NUM);
! 25: while ($row = $r->valid()) {
! 26: var_dump($r->current());
! 27: $r->next();
! 28: }
! 29: echo "DONE!\n";
! 30: ?>
! 31: --EXPECT--
! 32: array(1) {
! 33: [0]=>
! 34: string(3) "one"
! 35: }
! 36: array(1) {
! 37: [0]=>
! 38: string(3) "two"
! 39: }
! 40: array(1) {
! 41: [0]=>
! 42: string(5) "three"
! 43: }
! 44: DONE!
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>