diff options
| author | Marcus Boerger <helly@php.net> | 2003-06-14 18:16:47 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-06-14 18:16:47 +0000 |
| commit | 8f2b387c6147375501ad6de814bede9357fa4cf8 (patch) | |
| tree | 166846674ad10ce79ec826147c13a4bfeebd469d /ext/sqlite/tests/sqlite_016.phpt | |
| parent | d1bfc58aee0944095757e252074558c5809a55e9 (diff) | |
| download | php-git-8f2b387c6147375501ad6de814bede9357fa4cf8.tar.gz | |
- Update license
- Don't buffer in non buffered mode
Diffstat (limited to 'ext/sqlite/tests/sqlite_016.phpt')
| -rwxr-xr-x | ext/sqlite/tests/sqlite_016.phpt | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/ext/sqlite/tests/sqlite_016.phpt b/ext/sqlite/tests/sqlite_016.phpt new file mode 100755 index 0000000000..69ecc1202a --- /dev/null +++ b/ext/sqlite/tests/sqlite_016.phpt @@ -0,0 +1,42 @@ +--TEST-- +sqlite: fetch string +--INI-- +sqlite.assoc_case=0 +--SKIPIF-- +<?php # vim:ft=php +if (!extension_loaded("sqlite")) print "skip"; ?> +--FILE-- +<?php +include "blankdb.inc"; + +$data = array( + array (0 => 'one', 1 => 'two'), + array (0 => 'three', 1 => 'four') + ); + +sqlite_query("CREATE TABLE strings(a VARCHAR, b VARCHAR)", $db); + +foreach ($data as $str) { + sqlite_query("INSERT INTO strings VALUES('${str[0]}','${str[1]}')", $db); +} + +echo "====BUFFERED====\n"; +$r = sqlite_query("SELECT a, b from strings", $db); +while (sqlite_has_more($r)) { + var_dump(sqlite_fetch_string($r, SQLITE_NUM)); +} +echo "====UNBUFFERED====\n"; +$r = sqlite_unbuffered_query("SELECT a, b from strings", $db); +while (sqlite_has_more($r)) { + var_dump(sqlite_fetch_string($r, SQLITE_NUM)); +} +echo "DONE!\n"; +?> +--EXPECT-- +====BUFFERED==== +string(3) "one" +string(5) "three" +====UNBUFFERED==== +string(3) "one" +string(5) "three" +DONE! |
