note 28244 added to function.mysql-ping
| From: | admin at lunar dot ath dot cx | Date: | Tue, 07 Jan 2003 00:21:50 +0000 |
| Subject: | note 28244 added to function.mysql-ping | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41771@lists.php.net to get a copy of this message | ||
In relation to the above comment about checking if a mysql server is online: the call to
mysql_connect() should fail if the server you're attempting to connect to is not accessible; a
call to mysql_ping() is unneccesary in this context.
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.
--
http://www.php.net/manual/en/function.mysql-ping.php
http://master.php.net/manage/user-notes.php?action=edit+28244
http://master.php.net/manage/user-notes.php?action=delete+28244
http://master.php.net/manage/user-notes.php?action=reject+28244