update tests
[m6w6/ext-pq] / tests / cursor001.phpt
1 --TEST--
2 cursor
3 --SKIPIF--
4 <?php include "_skipif.inc"; ?>
5 --FILE--
6 <?php
7 echo "Test\n";
8
9 include "_setup.inc";
10
11 $c = new pq\Connection(PQ_DSN);
12 $p = $c->declare("mycursor", pq\Cursor::WITH_HOLD,
13 "SELECT * FROM generate_series(0,29) s WHERE (s%2)=0");
14 for ($r = $p->fetch(2); $r->numRows; $p->move(1), $r = $p->fetch(2)) {
15 foreach ($r as $row) {
16 foreach ($row as $col) {
17 echo " $col";
18 }
19 echo "\n";
20 }
21 }
22 ?>
23 ===DONE===
24 --EXPECT--
25 Test
26 0
27 2
28 6
29 8
30 12
31 14
32 18
33 20
34 24
35 26
36 ===DONE===