Tim Wheatley
08-29-2002, 09:17 PM
Hi,
When my forums get busy I get an error saying too many connections to line 38 of db_mysql.php
Line 38 is this line:
$this->link_id=mysql_pconnect($this->server,$this->user,$this->password);
Of this routine:
function connect() {
global $usepconnect;
// connect to db server
if ( 0 == $this->link_id ) {
if ($this->password=="") {
if ($usepconnect==1) {
$this->link_id=mysql_pconnect($this->server,$this->user);
} else {
$this->link_id=mysql_connect($this->server,$this->user);
}
} else {
if ($usepconnect==1) {
$this->link_id=mysql_pconnect($this->server,$this->user,$this->password);
} else {
$this->link_id=mysql_connect($this->server,$this->user,$this->password);
}
}
if (!$this->link_id) {
$this->halt("Link-ID == false, connect failed");
}
if ($this->database!="") {
if(!mysql_select_db($this->database, $this->link_id)) {
$this->halt("cannot use database ".$this->database);
}
}
}
}
When my forums get busy I get an error saying too many connections to line 38 of db_mysql.php
Line 38 is this line:
$this->link_id=mysql_pconnect($this->server,$this->user,$this->password);
Of this routine:
function connect() {
global $usepconnect;
// connect to db server
if ( 0 == $this->link_id ) {
if ($this->password=="") {
if ($usepconnect==1) {
$this->link_id=mysql_pconnect($this->server,$this->user);
} else {
$this->link_id=mysql_connect($this->server,$this->user);
}
} else {
if ($usepconnect==1) {
$this->link_id=mysql_pconnect($this->server,$this->user,$this->password);
} else {
$this->link_id=mysql_connect($this->server,$this->user,$this->password);
}
}
if (!$this->link_id) {
$this->halt("Link-ID == false, connect failed");
}
if ($this->database!="") {
if(!mysql_select_db($this->database, $this->link_id)) {
$this->halt("cannot use database ".$this->database);
}
}
}
}