2003-06-09 23:22:00 +00:00
|
|
|
--TEST--
|
|
|
|
sqlite: fetch all (array_query)
|
|
|
|
--INI--
|
|
|
|
sqlite.assoc_case=0
|
|
|
|
--SKIPIF--
|
|
|
|
<?php # vim:ft=php
|
|
|
|
if (!extension_loaded("sqlite")) print "skip"; ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
include "blankdb.inc";
|
|
|
|
|
|
|
|
$data = array(
|
|
|
|
"one",
|
|
|
|
"two",
|
|
|
|
"three"
|
|
|
|
);
|
|
|
|
|
|
|
|
sqlite_query("CREATE TABLE strings(a VARCHAR)", $db);
|
|
|
|
|
|
|
|
foreach ($data as $str) {
|
|
|
|
sqlite_query("INSERT INTO strings VALUES('$str')", $db);
|
|
|
|
}
|
|
|
|
|
|
|
|
$res = sqlite_array_query("SELECT a from strings", $db, SQLITE_NUM);
|
|
|
|
var_dump($res);
|
|
|
|
|
2003-12-05 13:42:04 +00:00
|
|
|
$db = null;
|
2003-12-05 02:12:21 +00:00
|
|
|
|
2003-06-09 23:22:00 +00:00
|
|
|
echo "DONE!\n";
|
|
|
|
?>
|
|
|
|
--EXPECTF--
|
|
|
|
array(3) {
|
|
|
|
[0]=>
|
|
|
|
array(1) {
|
|
|
|
[0]=>
|
|
|
|
string(3) "one"
|
|
|
|
}
|
|
|
|
[1]=>
|
|
|
|
array(1) {
|
|
|
|
[0]=>
|
|
|
|
string(3) "two"
|
|
|
|
}
|
|
|
|
[2]=>
|
|
|
|
array(1) {
|
|
|
|
[0]=>
|
|
|
|
string(5) "three"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DONE!
|