From:             [EMAIL PROTECTED]
Operating system: Win 32 (XP home)
PHP version:      4.1.2
PHP Bug Type:     MySQL related
Bug description:  Multiple MySQL connections causes crash when result is passed thru a 
function


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 bug report at http://bugs.php.net/?id=16665&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=16665&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=16665&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=16665&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=16665&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=16665&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=16665&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=16665&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=16665&r=submittedtwice

Reply via email to