RE: Suppressing halt on warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux