Annotation of embedaddon/php/ext/sqlite/tests/sqlite_025.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: sqlite: sqlite_fetch_object in a loop
! 3: --INI--
! 4: sqlite.assoc_case=0
! 5: --SKIPIF--
! 6: <?php # vim:ft=php
! 7: if (!extension_loaded("sqlite")) print "skip"; ?>
! 8: --FILE--
! 9: <?php
! 10: include "blankdb.inc";
! 11:
! 12: sqlite_query($db, "CREATE TABLE strings(a)");
! 13:
! 14: foreach (array("one", "two", "three") as $str) {
! 15: sqlite_query($db, "INSERT INTO strings VALUES('$str')");
! 16: }
! 17:
! 18: $res = sqlite_query("SELECT * FROM strings", $db);
! 19:
! 20: while (($obj = sqlite_fetch_object($res))) {
! 21: var_dump($obj);
! 22: }
! 23:
! 24: sqlite_close($db);
! 25: ?>
! 26: --EXPECTF--
! 27: object(stdClass)#1 (1) {
! 28: ["a"]=>
! 29: string(3) "one"
! 30: }
! 31: object(stdClass)#2 (1) {
! 32: ["a"]=>
! 33: string(3) "two"
! 34: }
! 35: object(stdClass)#1 (1) {
! 36: ["a"]=>
! 37: string(5) "three"
! 38: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>