From:             
Operating system: linux
PHP version:      5.3SVN-2011-09-20 (SVN)
Package:          MySQL related
Bug Type:         Bug
Bug description:Warning thrown

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 bug report at https://bugs.php.net/bug.php?id=55741&edit=1
-- 
Try a snapshot (PHP 5.4):            
https://bugs.php.net/fix.php?id=55741&r=trysnapshot54
Try a snapshot (PHP 5.3):            
https://bugs.php.net/fix.php?id=55741&r=trysnapshot53
Try a snapshot (trunk):              
https://bugs.php.net/fix.php?id=55741&r=trysnapshottrunk
Fixed in SVN:                        
https://bugs.php.net/fix.php?id=55741&r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55741&r=needdocs
Fixed in release:                    
https://bugs.php.net/fix.php?id=55741&r=alreadyfixed
Need backtrace:                      
https://bugs.php.net/fix.php?id=55741&r=needtrace
Need Reproduce Script:               
https://bugs.php.net/fix.php?id=55741&r=needscript
Try newer version:                   
https://bugs.php.net/fix.php?id=55741&r=oldversion
Not developer issue:                 
https://bugs.php.net/fix.php?id=55741&r=support
Expected behavior:                   
https://bugs.php.net/fix.php?id=55741&r=notwrong
Not enough info:                     
https://bugs.php.net/fix.php?id=55741&r=notenoughinfo
Submitted twice:                     
https://bugs.php.net/fix.php?id=55741&r=submittedtwice
register_globals:                    
https://bugs.php.net/fix.php?id=55741&r=globals
PHP 4 support discontinued:          
https://bugs.php.net/fix.php?id=55741&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=55741&r=dst
IIS Stability:                       
https://bugs.php.net/fix.php?id=55741&r=isapi
Install GNU Sed:                     
https://bugs.php.net/fix.php?id=55741&r=gnused
Floating point limitations:          
https://bugs.php.net/fix.php?id=55741&r=float
No Zend Extensions:                  
https://bugs.php.net/fix.php?id=55741&r=nozend
MySQL Configuration Error:           
https://bugs.php.net/fix.php?id=55741&r=mysqlcfg

Reply via email to