diff options
| author | Marcus Boerger <helly@php.net> | 2003-04-27 11:29:39 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-04-27 11:29:39 +0000 |
| commit | 88ef12964b1873b0a35f84f39ca0473fd251abb9 (patch) | |
| tree | 86ac4e91baf890ecfa860c36fde0a63c1f1a0b3e /ext/sqlite/tests/sqlite_007.phpt | |
| parent | ffe4ae85bb0865d0e158f361b8f43b43c57f6c43 (diff) | |
| download | php-git-88ef12964b1873b0a35f84f39ca0473fd251abb9.tar.gz | |
Add more tests
Diffstat (limited to 'ext/sqlite/tests/sqlite_007.phpt')
| -rwxr-xr-x | ext/sqlite/tests/sqlite_007.phpt | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/ext/sqlite/tests/sqlite_007.phpt b/ext/sqlite/tests/sqlite_007.phpt new file mode 100755 index 0000000000..b6174dbaca --- /dev/null +++ b/ext/sqlite/tests/sqlite_007.phpt @@ -0,0 +1,49 @@ +--TEST-- +sqlite: Simple insert/select (unbuffered) +--SKIPIF-- +<?php +if (!extension_loaded("sqlite")) print "skip"; ?> +--FILE-- +<?php +include "blankdb.inc"; + +sqlite_query("CREATE TABLE foo(c1 date, c2 time, c3 varchar(64))", $db); +sqlite_query("INSERT INTO foo VALUES ('2002-01-02', '12:49:00', NULL)", $db); +$r = sqlite_unbuffered_query("SELECT * from foo", $db); +var_dump(sqlite_fetch_array($r, SQLITE_BOTH)); +$r = sqlite_unbuffered_query("SELECT * from foo", $db); +var_dump(sqlite_fetch_array($r, SQLITE_NUM)); +$r = sqlite_unbuffered_query("SELECT * from foo", $db); +var_dump(sqlite_fetch_array($r, SQLITE_ASSOC)); +?> +--EXPECT-- +array(6) { + [0]=> + string(10) "2002-01-02" + ["c1"]=> + string(10) "2002-01-02" + [1]=> + string(8) "12:49:00" + ["c2"]=> + string(8) "12:49:00" + [2]=> + NULL + ["c3"]=> + NULL +} +array(3) { + [0]=> + string(10) "2002-01-02" + [1]=> + string(8) "12:49:00" + [2]=> + NULL +} +array(3) { + ["c1"]=> + string(10) "2002-01-02" + ["c2"]=> + string(8) "12:49:00" + ["c3"]=> + NULL +} |
