PHP 4.0 Bug #6105: odbc_pconnect returns 'not a valid ODBC-Link resource'
| From: | wls at wwco dot com | Date: | Fri, 11 Aug 2000 11:42:01 +0000 |
| Subject: | PHP 4.0 Bug #6105: odbc_pconnect returns 'not a valid ODBC-Link resource' | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-28527@lists.php.net to get a copy of this message | ||
From: wls@wwco.com
Operating system: NT 2000
PHP version: 4.0.1pl2
PHP Bug Type: Scripting Engine problem
Bug description: odbc_pconnect returns 'not a valid ODBC-Link resource'
Changing odbc_connect to odbc_pconnect causes the script to fail, complaining that the $odbchandle
"Supplied resource is not a valid ODBC-Link resource" on a odbc_close($odbchandle).
Leaving the code as is works perfectly.
...
// Connect to the database
$odbchandle = odbc_connect( $DSN, $USERNAME, $PASSWORD );
if ( $odbchandle ) {
// Query for the user record
$query = "SELECT * FROM Subscribers WHERE SubscriptionID='" . $subscriberID .
"'";
$queryresult = odbc_do( $odbchandle, $query );
// ...
odbc_close( $odbchandle );
...
It _seems_ that commenting out the odbc_close() when using the odbc_pconnect() causes the warning to
go away. Naturally this begs the question about when persistent handles go away... but still, I
wouldn't think odbc_close() causes a warning. Using odbc_close_all() works just fine, with no
warning.