Annotation of embedaddon/php/ext/oci8/tests/fetch_row.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: oci_fetch_row()
3: --SKIPIF--
4: <?php if (!extension_loaded('oci8')) die("skip no oci8 extension"); ?>
5: --FILE--
6: <?php
7:
8: require(dirname(__FILE__)."/connect.inc");
9:
10: // Initialize
11:
12: $stmtarray = array(
13: "drop table fetch_row_tab",
14: "create table fetch_row_tab (id number, value number)",
15: "insert into fetch_row_tab (id, value) values (1,1)",
16: "insert into fetch_row_tab (id, value) values (1,1)",
17: "insert into fetch_row_tab (id, value) values (1,1)",
18: );
19:
20: oci8_test_sql_execute($c, $stmtarray);
21:
22: // Run Test
23:
24: if (!($s = oci_parse($c, "select * from fetch_row_tab"))) {
25: die("oci_parse(select) failed!\n");
26: }
27:
28: if (!oci_execute($s)) {
29: die("oci_execute(select) failed!\n");
30: }
31: while ($row = oci_fetch_row($s)) {
32: var_dump($row);
33: }
34:
35: // Cleanup
36:
37: $stmtarray = array(
38: "drop table fetch_row_tab"
39: );
40:
41: oci8_test_sql_execute($c, $stmtarray);
42:
43: echo "Done\n";
44:
45: ?>
46: --EXPECTF--
47: array(2) {
48: [0]=>
49: %unicode|string%(1) "1"
50: [1]=>
51: %unicode|string%(1) "1"
52: }
53: array(2) {
54: [0]=>
55: %unicode|string%(1) "1"
56: [1]=>
57: %unicode|string%(1) "1"
58: }
59: array(2) {
60: [0]=>
61: %unicode|string%(1) "1"
62: [1]=>
63: %unicode|string%(1) "1"
64: }
65: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>