Back to index

php5  5.3.10
skipifconnectfailure.inc
Go to the documentation of this file.
00001 <?php
00002 require_once('connect.inc');
00003 if ($skip_on_connect_failure) {
00004        if ($socket)
00005               $myhost = sprintf("%s:%s", $host, $socket);
00006        else if ($port)
00007               $myhost = sprintf("%s:%s", $host, $port);
00008 
00009        if (!$link = @mysql_connect($myhost, $user, $passwd, true, $connect_flags))
00010               die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(), mysql_error()));
00011 
00012        if (!@mysql_select_db($db, $link))
00013               die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(), mysql_error()));
00014 
00015        mysql_close($link);
00016 }
00017 ?>