File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / mysql / tests / skipifconnectfailure.inc
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:58 2012 UTC (12 years, 5 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

<?php
require_once('connect.inc');
if ($skip_on_connect_failure) {
	if ($socket)
		$myhost = sprintf("%s:%s", $host, $socket);
	else if ($port)
		$myhost = sprintf("%s:%s", $host, $port);

	if (!$link = @mysql_connect($myhost, $user, $passwd, true, $connect_flags))
		die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(), mysql_error()));

	if (!@mysql_select_db($db, $link))
		die(sprintf("skip Can't connect to MySQL Server - [%d] %s", mysql_errno(), mysql_error()));

	mysql_close($link);
}
?>

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