php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #553 More than one ODBC_CONNECT gives back the same connectionnumber
Submitted: 1998-07-15 08:06 UTC Modified: 1998-08-13 16:12 UTC
From: Gerhard at frappe dot iaf dot nl Assigned:
Status: Closed Package: ODBC related
PHP Version: 3.0.1 OS: WINNT
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Gerhard at frappe dot iaf dot nl
New email:
PHP Version: OS:

 

 [1998-07-15 08:06 UTC] Gerhard at frappe dot iaf dot nl
<?
$testdb1 = odbc_connect("IntPhone","Gerhard","") || die("DIE FIEND, DIE!");
$testdb2 = odbc_connect("WebLog","SysDba","password") || die("DIE FIEND, DIE!");
print "test1 $testdb1<br>";
print "test2 $testdb2<br>";
?>

Results in both $testdb1 and $testdb2 having the value 1. The problem get real when on a page more than one database has to be opened like in:

<?
$testdb1 = odbc_connect("weblog","sysdba","password") || die("DIE FIEND, DIE!");
$res1 = odbc_exec($testdb1,"select count(distinct clienthost) from INETLOG");
print "Step 1, count: ".odbc_result($res1,1)."<br>";
odbc_close($testdb1) || die ("DIE close!");

$testdb2 = odbc_connect("weblog","sysdba","password") || die("DIE FIEND, DIE!");
$res2 = odbc_exec($testdb2,"select count(distinct target) from INETLOG");
print "Step 2, count: ".odbc_result($res2,1)."<br>";
odbc_close($testdb2);
?>

Here the script gives an error on the line starting with $res2. if the 4th line and the 6th line are removed things are working again but it becomes very difficul to use different independant scripts on a single page.

platform winNt, database Intrbase through ODBC, but also tested on a ODBC connection to a paradox database with the same results. PHP version 3.0.1 (the executable for download at the moment of writing.)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-08-13 16:12 UTC] shane
Current CVS does not have this problem (tested on NT4sp3 with access and foxpro drivers).  Please try it and resubmit bug report if your problem still occurs.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 15:01:28 2024 UTC