ID: 37527 Comment by: paul at quakenet dot org Reported By: bhines at alumni dot ucsd dot edu Status: Open Bug Type: ODBC related Operating System: Windows XP PHP Version: 5.1.6 New Comment:
Felipe, I can reproduce this (5.3 branch) and the patch attached does't appear to fix this issue. This issue only seems to occur when returning $mydb. If the odbc_pconnect is moved outside of pdb_Connect or the code function definition is changed to function &pdb_Connect(), the issue does not occur. With: $mydb = pdb_Connect(); odbc_close_all(); var_dump($mydb); Output is: resource(5) of type (odbc link persistent) Changing the code to not return $mydb e.g. call odbc_pconnect within printPage, result of the var_dump is: resource(5) of type (Unknown) Previous Comments: ------------------------------------------------------------------------ [2008-10-21 22:32:07] [email protected] Well, I can't reproduce it. ------------------------------------------------------------------------ [2008-10-21 11:38:01] [email protected] Was that fix applied? Does this bug exist in PHP_5_2 branch still? If so, please update the version.. ------------------------------------------------------------------------ [2008-02-17 17:22:46] [email protected] Possible fix: http://felipe.ath.cx/diff/bug37527.diff ------------------------------------------------------------------------ [2007-09-25 13:21:33] alexandra at zend dot com Hi There is a simple work-around to make this script work - there is a problem with the fact that you declared the $mydb var global in one function but not the other. You can change the printPage() function to solve this issue. function printPage() { global $mydb; $mydb = pdb_Connect(); odbc_close($mydb); print "Possibly Crashing now... "; $results = odbc_exec($mydb, 'SELECT * FROM _PDB_Access'); } ------------------------------------------------------------------------ [2006-09-29 23:22:16] bhines at alumni dot ucsd dot edu Still occurs in 5.1.6 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/37527 -- Edit this bug report at http://bugs.php.net/?id=37527&edit=1
