Re: need mysql_ping when using mysql_pconnect?

From: Date: Wed, 08 Aug 2007 01:06:37 +0000
Subject: Re: need mysql_ping when using mysql_pconnect?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-260373@lists.php.net to get a copy of this message
On Tue, August 7, 2007 3:58 am, lists@dwsasia.com wrote: > Just becasue you create a persistent connection it can still go down, > can't it? So therefore using mysql_ping inside of scripts with plenty > of idle time is useful? It can still go down, for sure. Using mysql_ping to see if it's still up at any given moment, though, is probably a bad idea. It can STILL go down between mysql_ping() and whatever (real) work you want to do with mysql. So you STILL need the same level of error-checking on your actual real work statements. So the ping is mostly just a waste of bandwidth. There might be a specific use-case of 'mysql_ping', such as some kind of "heartbeat" script that sends you an email if mysql has been down for more than X seconds. But you almost for sure don't want to just scatter mysql_ping throghout normal code. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So?

« previous php.general (#260373) next »