ID:               27932
 Updated by:       [EMAIL PROTECTED]
 Reported By:      shagren at ua dot fm
-Status:           Open
+Status:           Verified
-Bug Type:         ODBC related
+Bug Type:         Documentation problem
 Operating System: Win98
 PHP Version:      4.3.4
 New Comment:

>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.)




Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to