RE: [PHP-DB] Suppressing halt on warning

From: Date: Sun, 04 May 2003 22:42:30 +0000
Subject: RE: [PHP-DB] Suppressing halt on warning
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-27520@lists.php.net to get a copy of this message
> I'm attempting to configure a mysql connection so that a failover to a > replication database server can occur. When I call mysql_connect and the > connection fails, I would like to retry a new connection to the failover > server, however the first failed connection halts with a warning. How can > I suppress the halt so that PHP can continue to interpret the rest of my > code? If(!@mysql_connect(first host)) { mysql_connect(second host); } The @ will suppress the first warning message. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.db (#27520) next »