Bug #16665 Updated: Multiple MySQL connections causes crash when result is passed thru a function
| From: | lance_rushing at hotmail dot com | Date: | Wed, 17 Apr 2002 17:40:32 +0000 |
| Subject: | Bug #16665 Updated: Multiple MySQL connections causes crash when result is passed thru a function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-5214@lists.php.net to get a copy of this message | ||
ID: 16665
Updated by: lance_rushing@hotmail.com
Reported By: lance_rushing@hotmail.com
Status: Open
Bug Type: MySQL related
Operating System: Win 32 (XP home)
PHP Version: 4.1.2
New Comment:
Oops, forgot to say:
If I call the db_hostconnect more than once, then it causes the crash
(about 80% of the time). If I call the function once it works fine.
Previous Comments:
------------------------------------------------------------------------
[2002-04-17 13:37:16] lance_rushing@hotmail.com
I have a little bit of code for db connecting
If I call this function more than once in the script (e.i. to connect
to a 2nd database) php prompts Apache to send an error report using M$
bugreporting in XP.
The code crases using either mysql_pconnect or mysql_connect
//Crashes
function db_hostconnect($host, $db_user, $db_pass) {
$dbh = mysql_pconnect($host, $db_user, $db_pass);
// some code
return $dbh;
}
//still crashes
function db_hostconnect($host, $db_user, $db_pass) {
$dbh = mysql_pconnect($host, $db_user, $db_pass);
return $dbh;
}
//works
function db_hostconnect($host, $db_user, $db_pass) {
return mysql_pconnect($host, $db_user, $db_pass);
}
It appears to be something with moving the database handle into a
variable and then returning the variable.
Thanks.
When running a script that has more than one mysql_connect prompts
apache to send an error report (using M$ bug report feature in XP).
Commenting out one of the connections takes care of the problem.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=16665&edit=1