xref: /PHP-5.3/ext/pdo/tests/pdo_027.phpt (revision f987de46)
1--TEST--
2PDO Common: PDO::FETCH_LAZY
3--SKIPIF--
4<?php # vim:ft=php
5if (!extension_loaded('pdo')) die('skip');
6$dir = getenv('REDIR_TEST_DIR');
7if (false == $dir) die('skip no driver');
8require_once $dir . 'pdo_test.inc';
9PDOTest::skip();
10?>
11--FILE--
12<?php
13if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
14require_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
21foreach ($db->query("SELECT * FROM test", PDO::FETCH_LAZY) as $v) {
22	echo "lazy: " . $v->id.$v->name."\n";
23}
24echo "End\n";
25?>
26--EXPECT--
27lazy: 1test1
28lazy: 2test2
29End
30