ID: 16665
Updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
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] [EMAIL PROTECTED]
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