PHP 4.0 Bug #729 Updated: mysql_connect reuses connection ids
| From: | jimw@php.net | Date: | Sat, 10 Feb 2001 17:27:15 +0000 |
| Subject: | PHP 4.0 Bug #729 Updated: mysql_connect reuses connection ids | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-46142@lists.php.net to get a copy of this message | ||
ID: 729
Updated by: jimw
Reported By: walton@nordicdms.com
Old-Status: Open
Status: Closed
Bug Type: Feature/Change Request
Assigned To:
Comments:
i'm pretty sure this was fixed in 4.0.
Previous Comments:
---------------------------------------------------------------------------
[1998-09-09 02:02:52] walton@nordicdms.com
This can cause unpleasant problems when using a library function that cleans up after itself.
The script:
<?
function some_reuseable_function() {
// Pretend this function was included from another file
$conn2 = mysql_connect('host', 'uid', 'pwd');
echo "Function connection is: $conn2<br>n";
mysql_close($conn2);
}
$conn1 = mysql_connect('host', 'uid', 'pwd');
echo "Main connection is: $conn1<br>n";
some_reuseable_function();
mysql_close($conn1);
?>
The output:
Main connection is: 1
Function connection is: 1
Warning: 1 is not a MySQL link index in test.php3 on line 12
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=729&edit=2