$sth = $dbh->prepare ($sql); # im doing a mysql restart $sth->execute (); # DBD::mysql magically reconnects keeping the prepared statement and executes