Annotation of embedaddon/php/ext/oci8/tests/fetch_assoc.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: oci_fetch_assoc()
! 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: $stmtarray = array(
! 11: "drop table fetch_assoc_tab",
! 12: "create table fetch_assoc_tab (id number, value number, dummy varchar2(20))",
! 13: "insert into fetch_assoc_tab values (1,1,null)",
! 14: "insert into fetch_assoc_tab values (1,1,null)",
! 15: "insert into fetch_assoc_tab values (1,1,null)"
! 16: );
! 17:
! 18: oci8_test_sql_execute($c, $stmtarray);
! 19:
! 20: $select_sql = "select * from fetch_assoc_tab";
! 21:
! 22: if (!($s = oci_parse($c, $select_sql))) {
! 23: die("oci_parse(select) failed!\n");
! 24: }
! 25:
! 26: if (!oci_execute($s)) {
! 27: die("oci_execute(select) failed!\n");
! 28: }
! 29: while ($row = oci_fetch_assoc($s)) {
! 30: var_dump($row);
! 31: }
! 32:
! 33: // Clean up
! 34:
! 35: $stmtarray = array(
! 36: "drop table fetch_assoc_tab"
! 37: );
! 38:
! 39: oci8_test_sql_execute($c, $stmtarray);
! 40:
! 41: echo "Done\n";
! 42:
! 43: ?>
! 44: --EXPECT--
! 45: array(3) {
! 46: ["ID"]=>
! 47: string(1) "1"
! 48: ["VALUE"]=>
! 49: string(1) "1"
! 50: ["DUMMY"]=>
! 51: NULL
! 52: }
! 53: array(3) {
! 54: ["ID"]=>
! 55: string(1) "1"
! 56: ["VALUE"]=>
! 57: string(1) "1"
! 58: ["DUMMY"]=>
! 59: NULL
! 60: }
! 61: array(3) {
! 62: ["ID"]=>
! 63: string(1) "1"
! 64: ["VALUE"]=>
! 65: string(1) "1"
! 66: ["DUMMY"]=>
! 67: NULL
! 68: }
! 69: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>