1--TEST-- 2odbc_free_result(): Basic test 3--EXTENSIONS-- 4odbc 5--SKIPIF-- 6<?php include 'skipif.inc'; ?> 7--FILE-- 8<?php 9 10include 'config.inc'; 11 12$conn = odbc_connect($dsn, $user, $pass); 13 14odbc_exec($conn, 'CREATE TABLE free_result (TEST INT NOT NULL)'); 15 16odbc_exec($conn, 'INSERT INTO free_result VALUES (1), (2)'); 17 18$res = odbc_exec($conn, 'SELECT * FROM free_result'); 19 20var_dump(odbc_fetch_row($res)); 21var_dump(odbc_result($res, 'test')); 22var_dump(odbc_free_result($res)); 23try { 24 var_dump(odbc_free_result($conn)); 25} catch (TypeError $e) { 26 echo $e->getMessage(), "\n"; 27} 28try { 29 var_dump(odbc_fetch_row($res)); 30} catch (TypeError $e) { 31 echo $e->getMessage(), "\n"; 32} 33try { 34 var_dump(odbc_result($res, 'test')); 35} catch (TypeError $e) { 36 echo $e->getMessage(), "\n"; 37} 38?> 39--CLEAN-- 40<?php 41require 'config.inc'; 42$conn = odbc_connect($dsn, $user, $pass); 43odbc_exec($conn, 'DROP TABLE free_result'); 44?> 45--EXPECT-- 46bool(true) 47string(1) "1" 48bool(true) 49odbc_free_result(): supplied resource is not a valid ODBC result resource 50odbc_fetch_row(): supplied resource is not a valid ODBC result resource 51odbc_result(): supplied resource is not a valid ODBC result resource 52