Bug #55741 [Opn]: Warning thrown
| From: | laruence@php.net | Date: | Tue, 20 Sep 2011 14:50:21 +0000 |
| Subject: | Bug #55741 [Opn]: Warning thrown | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-163721@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55741&edit=1
ID: 55741
Updated by: laruence@php.net
Reported by: patrick_adrichem at hotmail dot com
Summary: Warning thrown
Status: Open
Type: Bug
Package: MySQL related
Operating System: linux
PHP Version: 5.3SVN-2011-09-20 (SVN)
-Assigned To:
+Assigned To: uw
Block user comment: N
Private report: N
New Comment:
ulf, plz look at this.
Previous Comments:
------------------------------------------------------------------------
[2011-09-20 14:47:19] patrick_adrichem at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.mysql-ping#refsect1-function.mysql-ping-description
---
Mysql_ping is in my vision used to check wether your connection is still alive, by pinging the
server since PHP 5.0.38 this function no longer autoreconnects, so its a real "Check if
connection is alive" function. However if the connection is not alive it still throws a
warning:
mysql_ping(): 8 is not a valid MySQL-Link resource
Which is obvious, because thats why you use this function...
Test script:
---------------
<?php
error_reporting(E_ALL);
$rConnection = mysql_connect("host", "user", "pass") or
die("Could not connect");
sleep(60);
if (false === mysql_ping($rConnection))
{
echo "Connection gone";
}
else
{
echo "Connection alive";
}
Expected result:
----------------
Connection gone
Actual result:
--------------
mysql_ping(): 8 is not a valid MySQL-Link resource
Connection gone
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55741&edit=1