Annotation of embedaddon/php/ext/mysql/tests/skipifconnectfailure.inc, revision 1.1.1.1

1.1       misho       1: <?php
                      2: require_once('connect.inc');
                      3: if ($skip_on_connect_failure) {
                      4:        if ($socket)
                      5:                $myhost = sprintf("%s:%s", $host, $socket);
                      6:        else if ($port)
                      7:                $myhost = sprintf("%s:%s", $host, $port);
                      8: 
                      9:        if (!$link = @mysql_connect($myhost, $user, $passwd, true, $connect_flags))
                     10:                die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(), mysql_error()));
                     11: 
                     12:        if (!@mysql_select_db($db, $link))
                     13:                die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(), mysql_error()));
                     14: 
                     15:        mysql_close($link);
                     16: }
                     17: ?>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>