|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11489 Sybase query result is getting destructed
Submitted: 2001-06-14 10:15 UTC Modified: 2001-07-23 13:42 UTC
From: pwmoosman at aol dot com Assigned:
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 4.0.5 OS: Solaris
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: pwmoosman at aol dot com
New email:
PHP Version: OS:


 [2001-06-14 10:15 UTC] pwmoosman at aol dot com
The following script produces the following error the second time getAppName/sybase_fetch_row is called.

Error (warning):

   /users/pmoosman/test_data/test1.php(26) : Warning - 3 is not a valid Sybase result resource



function getConnect()
  $db = sybase_connect('xxxx','yyy','zzz');
  return $db;

function getAppName($app_id) 

  // static $db;

  $sql = "select name from web_apps where application_id=$app_id";

  $db = getconnect();

  $result = sybase_query($sql, $db);

  $row = sybase_fetch_row($result);	

  // sybase_free_result($result);
  return $row[0];



Note: If I uncomment the "static $db" line, the error (warning) goes away.

I ran PHP in a debugger and it looks like the sybase connection is getting destructed when the sybase_query results are getting assigned to "$result".


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-28 01:16 UTC]
Cannot reproduce with CVS.
 [2001-07-23 12:11 UTC] pwmoosman at aol dot com
I was able to reproduce this problem in version 4.0.6. But, I was unable to reproduce it in the current cvs tree.
However, after looking at the mysql, and sybase (not sybase_ct) modules. I concluded that adding a reference to the global database connecting should be there. So I modified php_sybase_ct.c

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu May 19 06:05:44 2022 UTC