Jump to content

Can't connect to MySQL server on


otuatail

Recommended Posts

I have a very unreliable website host provider. sometimes I get an error on my ewebpage saying

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'mysql10.streamline.net' (4) in /home/fhlinux190/d/des-otoole.co.uk/user/htdocs/functions.inc on line 33

 

Is there anyway I can supress this message and if possible replace it with something more user frendly.

 

Desmond.

 

Link to comment
https://forums.phpfreaks.com/topic/66623-cant-connect-to-mysql-server-on/
Share on other sites

It would be quite silly to supress this error seeing as it is telling you that you are not connecting to the database. You might want to check your connection code.

 

However if you really want to supress it then just put a @ in front

 

mysql_connect becomes @mysql_connect

 

Hope that helps ;D

 

~ Chocopi

If the hosting company is unreliable then change it. Surpressing error messages maybe a good way to prevent errors shown on screen (probably to attackers) but not for healing such errors:

 

$connect = @mysql_connect(...) or die("There was an error connecting to the database");

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.