Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
So, how can I tell now if I'm disconnected ?$mysql->disconnect() ; $sth = $mysql->prepare(...) ; ......
So I assumed that if a request failed, the connection was lost. Anyway, to simulate a lost connection I added before the prepare() a$sth = $mysql->prepare(...) ; if ( ! $sth-execute() ) { # connection lost ? # reconnect }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: mysql_auto_reconnect
by idle (Friar) on Jan 27, 2006 at 12:38 UTC | |
by BMaximus (Chaplain) on Jan 27, 2006 at 16:13 UTC | |
|
Re: mysql_auto_reconnect
by Marcello (Hermit) on Jan 27, 2006 at 14:08 UTC |