note 23303 added to function.mysql-ping
| From: | php-general at lists dot php dot net | Date: | Mon, 15 Jul 2002 08:42:52 +0000 |
| Subject: | note 23303 added to function.mysql-ping | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33070@lists.php.net to get a copy of this message | ||
It´s realy helpful, when you will check if your mysql database is online or offline.
Maybe it´s on an other server, so you can check it.
example:
<?php
$connect=mysql_connect($db_host, $db_user, $db_password);
$db=mysql_select_db($db_name);
if(mysql_ping($connect)){
echo "your database is online",
} else {
echo "your database is offline",
}
mysql_close($connect);
?>
Hope it helps.
--
http://www.php.net/manual/en/function.mysql-ping.php
http://master.php.net/manage/user-notes.php?action=edit+23303
http://master.php.net/manage/user-notes.php?action=delete+23303
http://master.php.net/manage/user-notes.php?action=reject+23303