Suffered a trojan virus attack on Wordpress themes - how stop it happening again?

Not that it answers your query but might this account for your database not working?