xref: /PHP-5.3/ext/sqlite/tests/sqlite_009.phpt (revision 610c7fbe)
1--TEST--
2sqlite: fetch all (unbuffered)
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.inc";
11
12$data = array(
13	"one",
14	"two",
15	"three"
16	);
17
18sqlite_query("CREATE TABLE strings(a VARCHAR)", $db);
19
20foreach ($data as $str) {
21	sqlite_query("INSERT INTO strings VALUES('$str')", $db);
22}
23
24$r = sqlite_unbuffered_query("SELECT a from strings", $db);
25while ($row = sqlite_fetch_array($r, SQLITE_NUM)) {
26	var_dump($row);
27}
28
29sqlite_close($db);
30
31echo "DONE!\n";
32?>
33--EXPECT--
34array(1) {
35  [0]=>
36  string(3) "one"
37}
38array(1) {
39  [0]=>
40  string(3) "two"
41}
42array(1) {
43  [0]=>
44  string(5) "three"
45}
46DONE!
47