Annotation of embedaddon/php/ext/pdo/tests/pdo_027.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: PDO Common: PDO::FETCH_LAZY
! 3: --SKIPIF--
! 4: <?php # vim:ft=php
! 5: if (!extension_loaded('pdo')) die('skip');
! 6: $dir = getenv('REDIR_TEST_DIR');
! 7: if (false == $dir) die('skip no driver');
! 8: require_once $dir . 'pdo_test.inc';
! 9: PDOTest::skip();
! 10: ?>
! 11: --FILE--
! 12: <?php
! 13: if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
! 14: require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
! 15: $db = PDOTest::factory();
! 16:
! 17: $db->exec('create table test (id int, name varchar(10))');
! 18: $db->exec("INSERT INTO test (id,name) VALUES(1,'test1')");
! 19: $db->exec("INSERT INTO test (id,name) VALUES(2,'test2')");
! 20:
! 21: foreach ($db->query("SELECT * FROM test", PDO::FETCH_LAZY) as $v) {
! 22: echo "lazy: " . $v->id.$v->name."\n";
! 23: }
! 24: echo "End\n";
! 25: ?>
! 26: --EXPECT--
! 27: lazy: 1test1
! 28: lazy: 2test2
! 29: End
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>