Test props with Connection::prepare() as well as Statement ctor
[m6w6/ext-pq] / tests / bound002.phpt
1 --TEST--
2 fetch bound
3 --SKIPIF--
4 <?php
5 include "_skipif.inc";
6 ?>
7 --FILE--
8 <?php
9 echo "Test\n";
10
11 include "_setup.inc";
12
13 $c = new pq\Connection(PQ_DSN);
14 $r = $c->exec("select 1*a,2*a,3*a from generate_series(2,3) a");
15 $r->bind(0, $a);
16 $r->bind(1, $b);
17 $r->bind(2, $c);
18 while ($s = $r->fetchBound()) {
19 var_dump($s,$a,$b,$c);
20 }
21 ?>
22 DONE
23 --EXPECT--
24 Test
25 array(3) {
26 [0]=>
27 &int(2)
28 [1]=>
29 &int(4)
30 [2]=>
31 &int(6)
32 }
33 int(2)
34 int(4)
35 int(6)
36 array(3) {
37 [0]=>
38 &int(3)
39 [1]=>
40 &int(6)
41 [2]=>
42 &int(9)
43 }
44 int(3)
45 int(6)
46 int(9)
47 DONE