#27932 [Ver->Csd]: odbc_free_result cause warning when work with 2 connection

From: Date: Sat, 10 Apr 2004 10:50:51 +0000
Subject: #27932 [Ver->Csd]: odbc_free_result cause warning when work with 2 connection
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969359994@lists.php.net to get a copy of this message
ID: 27932 Updated by: nlopess@php.net Reported By: shagren at ua dot fm -Status: Verified +Status: Closed Bug Type: Documentation problem Operating System: Win98 PHP Version: 4.3.4 New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Previous Comments: ------------------------------------------------------------------------ [2004-04-09 11:32:40] sniper@php.net From php_odbc.c: " * We do have to hash non-persistent connections, and reuse connections. * In the case where two connects were being made, without closing the first * connect, access violations were occuring. This is because some of the * "globals" in this module should actualy be per-connection variables. I * simply fixed things to get them working for now. Shane " This has been in it since 1999. (manual says you can have multiple connections and that is true as long as they either use different db or different credentials.) ------------------------------------------------------------------------ [2004-04-09 09:43:16] shagren at ua dot fm Description: ------------ I use 2 odbc connection to ms-access database. When i close second connection, i cannot free result from first connection - php show warning. And first and second connections have identical resource id. Reproduce code: --------------- <?php error_reporting(E_ALL); //make 2 connection(ms-access database) $conn1 = odbc_connect("test_access", "", ""); $conn2 = odbc_connect("test_access", "", ""); //echo connection id echo "Connection1: $conn1 \nConnection2: $conn2\n"; //exec query $result = odbc_exec($conn1, "select count(*) from temp_table"); //close connection2 odbc_close($conn2); //free result from connection1 odbc_free_result($result); ?> Expected result: ---------------- Connection1: Resource id #1 Connection2: Resource id #2 Actual result: -------------- Connection1: Resource id #1 Connection2: Resource id #1 PHP Warning: odbc_free_result(): 2 is not a valid ODBC result resource in C:\Temp\test3.php on line 18 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27932&edit=1

« previous php.doc (#969359994) next »