php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6105 odbc_pconnect returns 'not a valid ODBC-Link resource'
Submitted: 2000-08-11 07:42 UTC Modified: 2001-03-08 20:18 UTC
From: wls at wwco dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 4.0.1pl2 OS: NT 2000
Private report: No CVE-ID: None
 [2000-08-11 07:42 UTC] wls at wwco dot com
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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-31 09:04 UTC] stas@php.net
reclassify
 [2001-01-02 10:51 UTC] kalowsky@php.net
Can you provide your configuration options by chance?  And does this still exist in the latest PHP?
 [2001-03-08 20:18 UTC] sniper@php.net
No feedback, and old version of PHP. 

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC