host-provider Posted October 27, 2013 Share Posted October 27, 2013 Hello, I have a code which i use to check mysql server is up or down it is showing correct result but if i want to add another ip of same server too how it is possible? <?php $server = "localhost"; $portg = "3306"; #$portl = "login server port"; $timeout = "2"; $game = @fsockopen("$server", $portg, $errno, $errstr, $timeout); echo "<br>SERVICE: "; echo $game ? "<font color=\"#00CC33\"><b>ONLINE</b></font>" : "<font color=\"red\"><b>OFFLINE</b></font>"; ?> Link to comment https://forums.phpfreaks.com/topic/283346-mysql-check-code/ Share on other sites More sharing options...
requinix Posted October 28, 2013 Share Posted October 28, 2013 Copy/paste and change the $server. Oh, and you should be closing the $game connection every time (if it did connect). Link to comment https://forums.phpfreaks.com/topic/283346-mysql-check-code/#findComment-1455797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.