summaryrefslogtreecommitdiff
path: root/ext/pdo/tests/pdo_027.phpt
blob: 468aeedc62ddbe72e19a2af3a4f11014912a92a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
--TEST--
PDO Common: PDO_FETCH_LAZY
--SKIPIF--
<?php # vim:ft=php
if (!extension_loaded('pdo')) die('skip');
$dir = getenv('REDIR_TEST_DIR');
if (false == $dir) die('skip no driver');
require_once $dir . 'pdo_test.inc';
PDOTest::skip();
?>
--FILE--
<?php
require getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
$db = PDOTest::factory();

$db->exec('create table test (id int, name varchar(10) NULL)');
$db->exec("INSERT INTO test (id,name) VALUES(1,'test1')");
$db->exec("INSERT INTO test (id,name) VALUES(2,'test2')");

foreach ($db->query("SELECT * FROM test", PDO_FETCH_LAZY) as $v) {
	echo "lazy: " . $v->id.$v->name."\n";
}
echo "End\n";
?>
--EXPECT--
lazy: 1test1
lazy: 2test2
End