Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Redirect users if there is a database connection error.

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #43051
    ajnoguerra
    Participant

    Hi guys, I’ve been playing with my php scripts for some time now, I just need a little help on how to redirect my visitors to another page that says a much clear message that the current website has encountered some **database connection error** or is under construction maybe. I have disabled error reporting which is – error_reporting(0);

    A really simple markup will be much appreciated. Thank you.

    error_reporting(0);

    $myconnection = mysql_connect(“localhost”,”root”,””) or die($myconnection);
    $dbconnection = mysql_select_db(“db”) or die($dbconnection);

    if (die($myconnection) === true){
    header(“Location: redirect.html”);
    }

Viewing 1 post (of 1 total)
  • The forum ‘Other’ is closed to new topics and replies.