Annotation of embedaddon/php/ext/pgsql/tests/17result.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: PostgreSQL pg_fetch_*() functions
3: --SKIPIF--
4: <?php include("skipif.inc"); ?>
5: --FILE--
6: <?php
7: error_reporting(E_ALL);
8:
9: include 'config.inc';
10:
11: $db = pg_connect($conn_str);
12:
13: $sql = "SELECT * FROM $table_name";
14: $result = pg_query($db, $sql) or die('Cannot qeury db');
15: $rows = pg_num_rows($result);
16:
17: var_dump(pg_result_seek($result, 1));
18: var_dump(pg_fetch_object($result));
19: var_dump(pg_fetch_array($result, 1));
20: var_dump(pg_fetch_row($result, 1));
21: var_dump(pg_fetch_assoc($result, 1));
22: var_dump(pg_result_seek($result, 0));
23:
24: echo "Ok\n";
25: ?>
26: --EXPECT--
27: bool(true)
28: object(stdClass)#1 (3) {
29: ["num"]=>
30: string(1) "1"
31: ["str"]=>
32: string(3) "ABC"
33: ["bin"]=>
34: NULL
35: }
36: array(6) {
37: [0]=>
38: string(1) "1"
39: ["num"]=>
40: string(1) "1"
41: [1]=>
42: string(3) "ABC"
43: ["str"]=>
44: string(3) "ABC"
45: [2]=>
46: NULL
47: ["bin"]=>
48: NULL
49: }
50: array(3) {
51: [0]=>
52: string(1) "1"
53: [1]=>
54: string(3) "ABC"
55: [2]=>
56: NULL
57: }
58: array(3) {
59: ["num"]=>
60: string(1) "1"
61: ["str"]=>
62: string(3) "ABC"
63: ["bin"]=>
64: NULL
65: }
66: bool(true)
67: Ok
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>