Annotation of embedaddon/php/ext/pgsql/tests/13pg_select_9.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: PostgreSQL pg_select() (9.0+)
3: --SKIPIF--
4: <?php
5: include("skipif.inc");
6: skip_server_version('9.0', '<');
7: ?>
8: --FILE--
9: <?php
10: error_reporting(E_ALL);
11:
12: include 'config.inc';
13:
14: $db = pg_connect($conn_str);
15: pg_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";
21: var_dump($res);
22: echo pg_select($db, $table_name, $ids, PGSQL_DML_STRING)."\n";
23: echo "Ok\n";
24:
25: ?>
26: --EXPECT--
27: array(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: }
38: SELECT * FROM "php_pgsql_test" WHERE "num"=1234;
39: Ok
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>