#16665 [Fbk->NoF]: Multiple MySQL connections causes crash when result is passed thru a function
| From: | georg@php.net | Date: | Sat, 24 Aug 2002 08:28:59 +0000 |
| Subject: | #16665 [Fbk->NoF]: 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-17744@lists.php.net to get a copy of this message | ||
ID: 16665
Updated by: georg@php.net
Reported By: lance_rushing@hotmail.com
-Status: Feedback
+Status: No Feedback
Bug Type: MySQL related
Operating System: Win 32 (XP home)
PHP Version: 4.1.2
Previous Comments:
------------------------------------------------------------------------
[2002-07-07 22:09:47] sniper@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately your are not using a current version of PHP --
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php
If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.
And if 4.2.1 doesn't work either, please add a complete,
short and self-containing script which causes the crash.
------------------------------------------------------------------------
[2002-04-17 13:40:31] lance_rushing@hotmail.com
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.
------------------------------------------------------------------------
[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