php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12432 not valid mysql ressource
Submitted: 2001-07-27 13:31 UTC Modified: 2002-06-18 18:37 UTC
From: etm at wkv dot at Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.6 OS: GNU Linux
Private report: No CVE-ID: None
 [2001-07-27 13:31 UTC] etm at wkv dot at
$eLink = mysql_connect(...);
.
.
.

class test {

  function einTest() {
    $eLink = mysql_connect();
    mysql_close($eLink);
  }

}

$aVar = new test();
$aVar->einTest();
mysql_query("...",$eLink);

-----> not valid mysql ressource

After einTest() it looks like it closes the outside mysql_connection ($eLink) no matter how the connection
var in einTest() is named!

Serious stuff!

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-27 20:43 UTC] mfischer@php.net
This is currently a feature. Although you haven't given full source I assume both 'mysql_connect()'s were the same. Two or more connects with the same parameter reuse the allready established connection and don't create a new one. So, closing one of them closes all other, too.

Re-Open if my assumption were wrong.
 [2001-07-30 02:59 UTC] etm at wkv dot at
The eMail system is not working correctly,
there is some more sourcecode in my message,
please watch it directly 

http://www.php.net/bugs.php?id=12432

First I thought it is some sort of scope problem,
but it is also reproducable with different var Names.
I think he ignores the link variable totally. Maybe
closes the default link (first created)
 [2001-07-30 05:56 UTC] sniper@php.net
This is still a feature, not a bug.

 [2001-07-30 07:38 UTC] etm at wkv dot at
I don't think it's a feature, its bug 8634,
sorry I missed that entry.

8634 is a urgent one I think!

 [2001-07-30 08:26 UTC] mfischer@php.net
Right, it's a bug. I mixed it up with some other mysql issue.

If was even myself one who came up with that issue and it was intended to be fixed for 4.0.6 ( http://marc.theaimsgroup.com/?l=php-dev&m=98721095516809&w=4 ), but no .. we don't blame Zeev that he didn't found time to do it ;-)
 [2002-06-18 18:37 UTC] sniper@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 08:01:30 2024 UTC