$sth = $mysql->prepare(...) ; if ( ! $sth-execute() ) { # connection lost ? # reconnect }