#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    3
    Rep Power
    0
    I'm trying to trap failed connection attempts to my MySQL database. Here's my code:

    if (mysql_connect(host, user, password)) {
    // Run a query
    } else {
    $errmsg = "Database unavailable.";
    }

    Everything works fine, but what happens is that when the code fails (eg, if the mysql service is not running) I get the failed connection message on my webpage, which I DON'T want. Any ideas?
  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Location
    Niagara Falls (On the wrong side of the gorge)
    Posts
    3,237
    Rep Power
    19
    You can place the @ sign before the function (ie @mysql_connect(foo)) to suppress or change your error reporting level in php.ini

Similar Threads

  1. HTML frames in flash, etc.
    By anubite in forum Flash Help
    Replies: 1
    Last Post: February 3rd, 2004, 01:15 AM
  2. How to get client email??Help plz
    By Gecko22 in forum ASP Programming
    Replies: 12
    Last Post: January 22nd, 2004, 02:40 PM
  3. not returning records when it should
    By aliaga61 in forum ASP Programming
    Replies: 3
    Last Post: January 16th, 2004, 11:57 AM
  4. 'Object required' error
    By aliaga61 in forum ASP Programming
    Replies: 1
    Last Post: January 16th, 2004, 09:48 AM

IMN logo majestic logo threadwatch logo seochat tools logo