edited queries to prevent troy from using sql injections to destroy the database