1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/odbc/tests/odbc_close_001.phpt
2024-04-28 15:45:56 +02:00

63 lines
1.1 KiB
PHP

--TEST--
odbc_close(): Basic test
--EXTENSIONS--
odbc
--SKIPIF--
<?php include 'skipif.inc'; ?>
--FILE--
<?php
include 'config.inc';
$conn1 = odbc_connect($dsn, $user, $pass);
$conn2 = odbc_pconnect($dsn, $user, $pass);
$result1 = odbc_columns($conn1, '', '', '', '');
$result2 = odbc_columns($conn2, '', '', '', '');
var_dump($conn1);
var_dump($conn2);
var_dump($result1);
var_dump($result2);
odbc_close($conn1);
odbc_close($conn2);
try {
odbc_columns($conn1, '', '', '', '');
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
try {
odbc_columns($conn2, '', '', '', '');
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
try {
odbc_num_rows($result1);
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
try {
odbc_num_rows($result2);
} catch (Error $e) {
echo $e->getMessage() . "\n";
}
?>
--EXPECTF--
object(Odbc\Connection)#%d (%d) {
}
object(Odbc\Connection)#%d (%d) {
}
object(Odbc\Result)#%d (%d) {
}
object(Odbc\Result)#%d (%d) {
}
ODBC connection has already been closed
ODBC connection has already been closed
ODBC result has already been closed
ODBC result has already been closed