Annotation of embedaddon/php/ext/odbc/tests/odbc_free_result_001.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: odbc_free_result(): Basic test
! 3: --SKIPIF--
! 4: <?php include 'skipif.inc'; ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: include 'config.inc';
! 9:
! 10: $conn = odbc_connect($dsn, $user, $pass);
! 11:
! 12: odbc_exec($conn, 'CREATE DATABASE odbcTEST');
! 13:
! 14: odbc_exec($conn, 'CREATE TABLE FOO (TEST INT)');
! 15: odbc_exec($conn, 'ALTER TABLE FOO ADD PRIMARY KEY FOO(TEST)');
! 16:
! 17: odbc_exec($conn, 'INSERT INTO FOO VALUES (1)');
! 18: odbc_exec($conn, 'INSERT INTO FOO VALUES (2)');
! 19:
! 20: $res = odbc_exec($conn, 'SELECT * FROM FOO');
! 21:
! 22: var_dump(odbc_fetch_row($res));
! 23: var_dump(odbc_result($res, 'test'));
! 24: var_dump(odbc_free_result($res));
! 25: var_dump(odbc_free_result($conn));
! 26: var_dump(odbc_free_result(NULL));
! 27: var_dump(odbc_fetch_row($res));
! 28: var_dump(odbc_result($res, 'test'));
! 29:
! 30: odbc_exec($conn, 'DROP TABLE FOO');
! 31:
! 32: odbc_exec($conn, 'DROP DATABASE odbcTEST');
! 33:
! 34: ?>
! 35: --EXPECTF--
! 36: bool(true)
! 37: string(1) "1"
! 38: bool(true)
! 39:
! 40: Warning: odbc_free_result(): supplied resource is not a valid ODBC result resource in %s on line %d
! 41: bool(false)
! 42:
! 43: Warning: odbc_free_result() expects parameter 1 to be resource, null given in %s on line %d
! 44: NULL
! 45:
! 46: Warning: odbc_fetch_row(): %d is not a valid ODBC result resource in %s on line %d
! 47: bool(false)
! 48:
! 49: Warning: odbc_result(): %d is not a valid ODBC result resource in %s on line %d
! 50: bool(false)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>