renamed references of db->query to db->execute

the db->query is deprecated so it's changed.