Jump to content

Warning: mysql_connect() [Is if possible to redirect if error message?]


montgomery

Recommended Posts

Once in a while when our hosting company has problems out site breaks and shows some ugly error messages:

 

"Warning: mysql_connect(): Too many connections in ./settings.inc.php on line 90"

 

This of course looks very unprofessional.

 

What can I do to redirect the user to an "under maintenance" page, every time the problem occurs?

 

Thanks a lot!!

 

Montgomery

I found the line 90 in settings.inc.php where the error occurs:

 

if(!mysql_connect($DbHost,$DbUser,$DbPassword)) {
$NOTCONNECTED = TRUE;
}

 

could I just change it to:

 

if(!mysql_connect($DbHost,$DbUser,$DbPassword)) {
$NOTCONNECTED = TRUE;
        header("Location: www.sample.php");
}

could I just change it to:

 

if(!mysql_connect($DbHost,$DbUser,$DbPassword)) {
$NOTCONNECTED = TRUE;
        header("Location: www.sample.php");
}

 

Yes, although the variable $NOTCONNECTED will be linked somewhere else in the script, so I would check that out to see what it does.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.