mirror of
https://github.com/danog/ext-pq.git
synced 2024-12-02 09:18:02 +01:00
37 lines
491 B
PHP
37 lines
491 B
PHP
--TEST--
|
|
cursor
|
|
--SKIPIF--
|
|
<?php include "_skipif.inc"; ?>
|
|
--FILE--
|
|
<?php
|
|
echo "Test\n";
|
|
|
|
include "_setup.inc";
|
|
|
|
$c = new pq\Connection(PQ_DSN);
|
|
$p = $c->declare("mycursor", pq\Cursor::WITH_HOLD,
|
|
"SELECT * FROM generate_series(0,29) s WHERE (s%2)=0");
|
|
for ($r = $p->fetch(2); $r->numRows; $p->move(1), $r = $p->fetch(2)) {
|
|
foreach ($r as $row) {
|
|
foreach ($row as $col) {
|
|
echo " $col";
|
|
}
|
|
echo "\n";
|
|
}
|
|
}
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
Test
|
|
0
|
|
2
|
|
6
|
|
8
|
|
12
|
|
14
|
|
18
|
|
20
|
|
24
|
|
26
|
|
===DONE===
|