note 30520 added to function.mysql-ping
| From: | melnabone at rack1 dot php dot net | Date: | Thu, 20 Mar 2003 21:30:30 +0000 |
| Subject: | note 30520 added to function.mysql-ping | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45574@lists.php.net to get a copy of this message | ||
>
>The true value of mysql_ping() is when your script has >already opened a valid connection and
>is in the middle of
>a lengthy operation. If your calls start to fail, you can call
>mysql_ping() to check and reestablish the connection if >need be.
>
This isn't the only angle to take! I use this as part of a server that communicates with a
cluster manager. Every thirty seconds I use mysql_ping to check that I have still have a connection
and therefore (?) a live database. If it returns false, then the server shuts down and the cluster
manager takes appropriate action.
Cheers,
BDKR
--
http://www.php.net/manual/en/function.mysql-ping.php
http://master.php.net/manage/user-notes.php?action=edit+30520
http://master.php.net/manage/user-notes.php?action=delete+30520
http://master.php.net/manage/user-notes.php?action=reject+30520