Hyperjase Posted August 3, 2008 Share Posted August 3, 2008 Hey guys, This is probably something very simple but how do I go about checking if a remote MySQL database is online ... then if it is, carry on with the rest of the sript, or if it's offline - show a page on the server. I have an idea how to do it ... but can't quite get it straight in my head. HJ Link to comment https://forums.phpfreaks.com/topic/117980-solved-mysql-connect-check-if-present/ Share on other sites More sharing options...
unkwntech Posted August 3, 2008 Share Posted August 3, 2008 <?php $link = mysql_connect(...) or die(//do if link fails); or if you don't want the script to die do this <?php $link = mysql_connct(...); if(!$link) { //Fail } //pass Link to comment https://forums.phpfreaks.com/topic/117980-solved-mysql-connect-check-if-present/#findComment-606957 Share on other sites More sharing options...
Hyperjase Posted August 3, 2008 Author Share Posted August 3, 2008 Perfect! Thanks for the extremely quick reply too!! Works like a charm! HJ Link to comment https://forums.phpfreaks.com/topic/117980-solved-mysql-connect-check-if-present/#findComment-606998 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.