简体   繁体   中英

php reload page when mysql dies

是否有任何方法可以让这个页面在mysql死机时重新加载,所以它会一直反复运行,因为一段时间后连接会死掉,超时是我的猜测

Do like this, refresh after threee seconds...

$link = mysql_connect("localhost", "", ""); 
if (!$link) {
    echo "Connection lost will refresh in 3 sec";
    header("Refresh: 3");
    exit();
}

尝试,

 mysql_connect("localhost", "", "") or die(header( "refresh:5;" ));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM