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