xref: /PHP-8.3/ext/pgsql/tests/13pg_select.phpt (revision e378968c)
1--TEST--
2PostgreSQL pg_select()
3--EXTENSIONS--
4pgsql
5--SKIPIF--
6<?php
7include("skipif.inc");
8skip_server_version('8.5dev', '>=');
9?>
10--FILE--
11<?php
12error_reporting(E_ALL);
13
14include 'config.inc';
15
16$db = pg_connect($conn_str);
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(3) "BBB"
36  }
37}
38SELECT * FROM "php_pgsql_test" WHERE "num"=1234;
39Ok
40