php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28484 Resource type lost for ResultSet if returned in function
Submitted: 2004-05-22 07:52 UTC Modified: 2004-05-22 18:50 UTC
From: tjd1066 at rit dot edu Assigned:
Status: Not a bug Package: ODBC related
PHP Version: 4.3.6 OS: Win XP/Apache 2.048
Private report: No CVE-ID: None
 [2004-05-22 07:52 UTC] tjd1066 at rit dot edu
Description:
------------
Mysql over ODBC connection is the DB in use.
PHP win32 zip binary dist no compile options set by me.

If odbc_exec() is performed in a function it performs well and returns a result resource. However if that result resource is that returned by the function the type value that was ODBC Result changes to unknown.  

extension=php_java.dll
extension=php_pgsql.dll
session.save_path = "C:\php\tmp"

Reproduce code:
---------------
function doQuery ($p_Query = ""){
	
global $g_DatabaseName, $g_DBUserName, $g_DBPassword;
$v_DBHandle = odbc_connect($g_DatabaseName,$g_DBUserName,$g_DBPassword);
	
$v_QueryResult = odbc_exec( $v_DBHandle, $p_Query);
var_dump($v_QueryResult);
		disposeDBHandle($v_DBHandle);
		return $v_QueryResult;
}

$result=doQuery("SELECT * FROM SHIPPERS;");
var_dump($result);

Expected result:
----------------
resource(34) of type (odbc result) 

Actual result:
--------------
resource(34) of type (Unknown) 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-22 18:50 UTC] tjd1066 at rit dot edu
Sorry was closing the connection didn't realize it.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat May 28 04:06:34 2022 UTC