1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Is there a way to replace "Error establishing a database connection" with a redirect?

Discussion in 'Blogging' started by tpaolo, Jun 1, 2012.

  1. tpaolo

    tpaolo Regular Member

    Joined:
    May 28, 2009
    Messages:
    333
    Likes Received:
    45
    I'm using a cheap seo hosting that sometimes goes on tilt and gives me this error, I'd like to know if there is a way to setup a redirect to a given site when database doesn't work.

    Thanks.
     
  2. Zapdos

    Zapdos Power Member

    Joined:
    Oct 22, 2011
    Messages:
    597
    Likes Received:
    708
    Location:
    Eastern North Carolina
    $db = mysql_connect(..);
    if (!$db) { /* Redirect code */ }
     
  3. tpaolo

    tpaolo Regular Member

    Joined:
    May 28, 2009
    Messages:
    333
    Likes Received:
    45
    Thanks for quick reply, where should I put it?