Annotation of embedaddon/php/ext/oci8/tests/fetch.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: ocifetch() & ociresult()
                      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_tab",
                     14:     "create table fetch_tab (id number, value number)",
                     15:     "insert into fetch_tab (id, value) values (1,1)",
                     16:     "insert into fetch_tab (id, value) values (1,1)",
                     17:     "insert into fetch_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_tab"))) {
                     25:        die("oci_parse(select) failed!\n");
                     26: }
                     27: 
                     28: if (!oci_execute($s)) {
                     29:        die("oci_execute(select) failed!\n");
                     30: }
                     31: 
                     32: while(ocifetch($s)) {
                     33:                $row = ociresult($s, 1);
                     34:                $row1 = ociresult($s, 2);
                     35:                var_dump($row);
                     36:                var_dump($row1);
                     37: }
                     38: 
                     39: // Cleanup
                     40: 
                     41: $stmtarray = array(
                     42:     "drop table fetch_tab"
                     43: );
                     44: 
                     45: oci8_test_sql_execute($c, $stmtarray);
                     46:        
                     47: echo "Done\n";
                     48: ?>
                     49: --EXPECTF--
                     50: %unicode|string%(1) "1"
                     51: %unicode|string%(1) "1"
                     52: %unicode|string%(1) "1"
                     53: %unicode|string%(1) "1"
                     54: %unicode|string%(1) "1"
                     55: %unicode|string%(1) "1"
                     56: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>