Welcome to Geeklog, Anonymous Saturday, November 30 2024 @ 04:26 pm EST

Geeklog Forums

Change message "No Mysql connection"


Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
When there is a problem with mysql server the following message is displayed :
Warning: mysql_connect(): Too many connections in /home/ecologie/system/databases/mysql.class.php on line 112
Cannnot connect to DB server


What mod can we do to display a nice page to inform the visitors that the problem will be solve as soon as possible?

Ben.
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
In system/databases/mysql.class.php find this line:
Text Formatted Code
// Connect to MySQL server
$this->_db = mysql_connect($this->_host,$this->_user,$this->_pass) or die('Cannnot connect to DB server');
 

The "Warning:" probably comes from the mysql_connect and can be suppressed by putting an @ sign in front of it. And then you could replace the die() text with whatever you prefer.

Text Formatted Code
$this->_db = @mysql_connect($this->_host,$this->_user,$this->_pass) or die('Oops, sorry. Please try again in a few minutes.');
 

bye, Dirk
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Thanks a lot mister Dirk.

Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

Status: offline

::Ben

Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
A redirection to another page is possible. Replace

Text Formatted Code
die('Cannnot connect to DB server');

by

header("Location: http://www.mysite.com/page.html");


 



Ben
I'm available to customise your themes or plugins for your Geeklog CMS
 Quote

All times are EST. The time is now 04:26 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content