📄 sqlite_oo_014.phpt
字号:
--TEST--sqlite-oo: fetch all--INI--sqlite.assoc_case=0--SKIPIF--<?php # vim:ft=phpif (!extension_loaded("sqlite")) print "skip"; ?>--FILE--<?php include "blankdb_oo.inc";$data = array( "one", "two", "three" );$db->query("CREATE TABLE strings(a VARCHAR)");foreach ($data as $str) { $db->query("INSERT INTO strings VALUES('$str')");}echo "unbuffered twice\n";$r = $db->unbufferedQuery("SELECT a from strings", SQLITE_NUM);var_dump($r->fetchAll());var_dump($r->fetchAll());echo "unbuffered with fetch_array\n";$r = $db->unbufferedQuery("SELECT a from strings", SQLITE_NUM);var_dump($r->fetch());var_dump($r->fetchAll());echo "buffered\n";$r = $db->query("SELECT a from strings", SQLITE_NUM);var_dump($r->fetchAll());var_dump($r->fetch());var_dump($r->fetchAll());echo "DONE!\n";?>--EXPECTF--unbuffered twicearray(3) { [0]=> array(1) { [0]=> string(3) "one" } [1]=> array(1) { [0]=> string(3) "two" } [2]=> array(1) { [0]=> string(5) "three" }}Warning: SQLiteUnbuffered::fetchAll(): One or more rowsets were already returned; returning NULL this time in %ssqlite_oo_014.php on line %darray(0) {}unbuffered with fetch_arrayarray(1) { [0]=> string(3) "one"}array(2) { [0]=> array(1) { [0]=> string(3) "two" } [1]=> array(1) { [0]=> string(5) "three" }}bufferedarray(3) { [0]=> array(1) { [0]=> string(3) "one" } [1]=> array(1) { [0]=> string(3) "two" } [2]=> array(1) { [0]=> string(5) "three" }}bool(false)array(3) { [0]=> array(1) { [0]=> string(3) "one" } [1]=> array(1) { [0]=> string(3) "two" } [2]=> array(1) { [0]=> string(5) "three" }}DONE!--UEXPECTF--unbuffered twicearray(3) { [0]=> array(1) { [0]=> unicode(3) "one" } [1]=> array(1) { [0]=> unicode(3) "two" } [2]=> array(1) { [0]=> unicode(5) "three" }}Warning: SQLiteUnbuffered::fetchAll(): One or more rowsets were already returned; returning NULL this time in %ssqlite_oo_014.php on line %darray(0) {}unbuffered with fetch_arrayarray(1) { [0]=> unicode(3) "one"}array(2) { [0]=> array(1) { [0]=> unicode(3) "two" } [1]=> array(1) { [0]=> unicode(5) "three" }}bufferedarray(3) { [0]=> array(1) { [0]=> unicode(3) "one" } [1]=> array(1) { [0]=> unicode(3) "two" } [2]=> array(1) { [0]=> unicode(5) "three" }}bool(false)array(3) { [0]=> array(1) { [0]=> unicode(3) "one" } [1]=> array(1) { [0]=> unicode(3) "two" } [2]=> array(1) { [0]=> unicode(5) "three" }}DONE!
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -