Jump to content

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");

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.