Bug #11489 Updated: Sybase query result is getting destructed
| From: | joey@php.net | Date: | Thu, 28 Jun 2001 05:16:27 +0000 |
| Subject: | Bug #11489 Updated: Sybase query result is getting destructed | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-58289@lists.php.net to get a copy of this message | ||
ID: 11489
Updated by: joey
Reported By: pwmoosman@aol.com
Old-Status: Open
Status: Feedback
Bug Type: Sybase-ct (ctlib) related
Operating system:
PHP Version: 4.0.5
Assigned To:
Comments:
Cannot reproduce with CVS.
Previous Comments:
---------------------------------------------------------------------------
[2001-06-14 10:15:16] pwmoosman@aol.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
Script:
<?php
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];
}
getAppName(23);
getAppName(23);
?>
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".
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11489&edit=2