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