|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-02-10 12:27 UTC] jimw@php.net
[2022-12-08 12:51 UTC] git@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 14:00:01 2025 UTC |
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