sqlite_oo_014.phpt
来自「PHP v6.0 For Linux 运行环境:Win9X/ WinME/ Wi」· PHPT 代码 · 共 196 行
PHPT
196 行
--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 + =
减小字号Ctrl + -
显示快捷键?