note 78184 added to function.mysql-ping
| From: | oscar at bitagenda dot com | Date: | Tue, 02 Oct 2007 11:10:52 +0000 |
| Subject: | note 78184 added to function.mysql-ping | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-130980@lists.php.net to get a copy of this message | ||
Very confusing description.
... If it has gone down, an automatic reconnection is attempted
(But the function returns only true or false, so if you have variable say $link = connection
resource, it will be an invalid resource)
Then ...
... Note: Since MySQL 5.0.13, automatic reconnection feature is disabled.
OK, if it returns false, I have the chance to reconnect updating my resource variable
$link = reconnect
But I did called the function with $link to do the check, so ...
If no such link is found, it will try to create one as if mysql_connect() was called with no
arguments (this are different arguments than automatic reconnection, doesn't it? I think,
automatic reconnecting, say to $link, would be with its own arguments previously used to create the
connection)
So bad decision about automatic recconection feature disabled ...
At least the function should have the param by reference, so in case it reconnects with a new
link_identifier.
bool mysql_ping ( &[resource $link_identifier] )
Or a return value of link_identifier, not true.
if ($link=mysql_ping($link)) {...} else { whatever }
----
Server IP: 69.147.83.197
Probable Submitter: 200.53.248.25
----
Manual Page -- http://www.php.net/manual/en/function.mysql-ping.php
Edit -- https://master.php.net/note/edit/78184
Del: integrated -- https://master.php.net/note/delete/78184/integrated
Del: useless -- https://master.php.net/note/delete/78184/useless
Del: bad code -- https://master.php.net/note/delete/78184/bad+code
Del: spam -- https://master.php.net/note/delete/78184/spam
Del: non-english -- https://master.php.net/note/delete/78184/non-english
Del: in docs -- https://master.php.net/note/delete/78184/in+docs
Del: other reasons-- https://master.php.net/note/delete/78184
Reject -- https://master.php.net/note/reject/78184
Search -- https://master.php.net/manage/user-notes.php