File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ sqlite: fetch all (array_query)
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.inc " ;
11
+
12
+ $ data = array (
13
+ "one " ,
14
+ "two " ,
15
+ "three "
16
+ );
17
+
18
+ sqlite_query ("CREATE TABLE strings(a VARCHAR) " , $ db );
19
+
20
+ foreach ($ data as $ str ) {
21
+ sqlite_query ("INSERT INTO strings VALUES(' $ str') " , $ db );
22
+ }
23
+
24
+ $ res = sqlite_array_query ("SELECT a from strings " , $ db , SQLITE_NUM );
25
+ var_dump ($ res );
26
+
27
+ echo "DONE! \n" ;
28
+ ?>
29
+ --EXPECTF--
30
+ array(3) {
31
+ [0]=>
32
+ array(1) {
33
+ [0]=>
34
+ string(3) "one"
35
+ }
36
+ [1]=>
37
+ array(1) {
38
+ [0]=>
39
+ string(3) "two"
40
+ }
41
+ [2]=>
42
+ array(1) {
43
+ [0]=>
44
+ string(5) "three"
45
+ }
46
+ }
47
+ DONE!
You can’t perform that action at this time.
0 commit comments