xref: /PHP-5.5/ext/pgsql/tests/13pg_select_9.phpt (revision f718684a)
1--TEST--
2PostgreSQL pg_select() (9.0+)
3--SKIPIF--
4<?php
5include("skipif.inc");
6skip_server_version('9.0', '<');
7?>
8--FILE--
9<?php
10error_reporting(E_ALL);
11
12include 'config.inc';
13
14$db = pg_connect($conn_str);
15pg_query("SET bytea_output = 'hex'");
16
17$fields = array('num'=>'1234', 'str'=>'ABC', 'bin'=>'XYZ');
18$ids = array('num'=>'1234');
19
20$res = pg_select($db, $table_name, $ids) or print "Error\n";
21var_dump($res);
22echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING)."\n";
23echo "Ok\n";
24
25?>
26--EXPECT--
27array(1) {
28  [0]=>
29  array(3) {
30    ["num"]=>
31    string(4) "1234"
32    ["str"]=>
33    string(3) "AAA"
34    ["bin"]=>
35    string(8) "\x424242"
36  }
37}
38SELECT * FROM "php_pgsql_test" WHERE "num"=1234;
39Ok